01 Getting Started

In this tutorial, we will review how to generate a document from a Salesforce Flow. In other articles we have discussed how to generate and send documents manually, so check them out if you need to know how.

In this tutorial, we will cover one way of generating a document automatically.
1. Go into Salesforce and find your Setup Flows page and then click on the New Flow button.
new flow button
2. You can choose any of the Flow options but for this tutorial, we will choose Record-Triggered Flow before clicking on the Create button.
record triggered flow
3. Configure your Start settings. The example document that we created is associated with an account so we will choose Account in the Object search field.
4. Select the “A record is created or updated“ radio button.
5. Select your conditions from the drop-down menu. We have chosen All Conditions Are Met (AND) > Industry Equals Apparel.
6. Click on the Done button to proceed.
Configure start

02 Add an Action to a Record-Triggered Flow

1. Click on the + button to add an action.
Add trigger flow
2. Choose Action as your Interaction.
action
3. Find and select Form_Builder_FTDocGen in the Action search field.
4. Enter a name in the Label and API Name fields.
New Action Label
5. You will now need the ftAPIKey, the ftFormHash, and the objectID. Get your values from within the Titan Form builder. Find your Word Mapping options under Settings and click on the Configure button.
configure mapping
6. Navigate to the Process Builder element in the menu and click on the Configure button.
process builder
7. Select your Object and map your Record ID with the drop-down menus. We have chosen Account for the object and RecordID (fid2) for the Record ID.
Map ID
8. Titan automatically generates a ftFormHash and ftApiKey that you can copy and paste into your Salesforce action.
9. Choose the AccountID for the objectID search field before clicking on the Done button.
API Keys
10. Save your action.
Save icon
11. Add a name to your Flow Label and Flow API Name fields before clicking on the Save button.
Name document
12. Click on the Activate button to activate your Flow.
Activate button

03 What happens when your Flow is Invoked?

Firstly, your document will be generated. But what occurs will depend on what we set up in the Titan Form builder under the Salesforce Push integration.
For this example, we previously set a Push to create a file and attach it to a record. So, that is what will happen when this document is generated.

04 Testing your Example

1. Change the Industry field to Apparel.
change industry
2. Click the Save button and wait a few seconds for the document to generate.
3. Notice you now have a document generated under your Files menu.
Updated file

05 Got Feedback?

Additional Resources