FORM Butler allows you to execute Actions after Form Submission, such as generating a document, generating and downloading a document, sending an email, or redirecting the user to another page.
If you have experience making PDF Butler Word Doc Configs, you can skip Step 1
Сreate a Doc Config #
The Doc Config should have the ‘Main Word Document’ record type.

In the created Doc Config, enter the document title. It will be the name of the generated document.

Link Data Sources to the Doc Config. #
You can link only Data Sources of type ‘Single sObject’

Next Step:
Prepare a Word document with merge fields. The merge fields will retrieve data from the Web Form that you submit.
You can see an example of a document with merge fields below.

Go to the Pdf Butler
Click ‘Open PDF Butler’ in Doc Config


Next, add the Data Sources and select the Config Type


Example of an added Data Config

Next, add the prepared document with the same merge fields.
Note: The Data Config must contain the same fields that were added to the document. Only this document will be included as the After Action document.
Click Choose File and attach the document.


Once the document is added, click the ‘Save to Server’ button

The system should save without errors

Flow Configuration #
There are three available types in the Flow: Files, Text, and Redirection URL.
Set the value in Assign After-Action Type to Files (for example)

Also, add the ID of the Doc Config. This should be the Doc Config with the ‘Main Word Document’ record type that was created and configured earlier.


Save the Flow as a new version and activate it.
Create a Web Form #
Go to the Web Form Editor and add the same fields that are used in the document to the form. Then save the form.

Go to the Doc Config and first create an Unattached Form Request

Once the Unattached Form is created, enter the API name of the Flow in the ‘After Action’ field on the Form Request

Open the Form Request link, enter some data, and click ‘Submit Form’

You can download the files


Create Request from Account


Note: If it is an Unattached Form, the file will be attached to the Form Request.
If the Web Form is created from an Account (for example), the file will be attached to the Account.


Account

Redirection URL #
Go to the Flow and change the type to Redirection URL.

Add New Variable ‘redirectionURL’

Save the Flow as a new version and activate it.
Create an Unattached or Attached Form Request and submit the form.
After submission, you will see the redirection message.

Then, the user should be redirected to the site specified in the Flow

Text #
Add a new resource – Variable – in the Flow.
Set the following values:
- API Name: message
- Data Type: Text
- Available for Output: True
Then, enter the text you want to display after submitting the form in the Default Value field

Save the Flow as a new version and activate it.
Create an Unattached or Attached Form, enter the data, and submit the form.

Note: If you use the Redirection URL or Message type, after submitting the form, the file will be attached to the Form Request (if it is an Unattached Form) or to the Account (if it is an Attached Form).
Configure Flow
Create Assigment


Set Data Source Assigment
Value = id of Data source Account
Create Variable ‘valuesDataSource’


Loop – Loop updatables


Next one
Create Variable


Create dataSourceData




Create an Apex Action.
Set the Doc Config ID to the Doc Config with the ‘Main Word Document’ record type.



