Generating documents from Salesforce flows
Once you have installed our Salesforce package and set up the Inkit app in Salesforce, you can automatically generate documents from your Salesforce flows. You can generate documents based on an event or on a regular schedule.
In this tutorial, we will show you how to generate a proposal when the Stage of a Sales Opportunity is set to Proposal/Price Quote.
Creating a template and copying its ID
Before you can create a Salesforce flow and trigger it, you need to create an Inkit template for the proposal and embed the Salesforce fields into it. To use this template in your Salesforce flow, copy the ID of the template from the Inkit web app by selecting Templates in the left sidebar and then clicking the copy button by the template whose ID you want to copy.
Creating a Salesforce flow
To create a Salesforce flow that will automatically generate a proposal from the Inkit template you created, do the following:
-
In Salesforce, click the settings gear and then click Setup.
-
In the Setup page, enter flows in the Quick Find field and click Flows under Process Automation.
-
In the Flows panel, click New Flow.
-
In the New Flow dialog box, select Record-Triggered Flow and click Create.
Note: You can trigger the generation of Inkit documents in other ways, such as on a regular schedule.
-
In the Configure Start dialog box, select Opportunity from the Object dropdown box.
Then, choose A record is updated for the Trigger the Flow When option and set the Condition Requirements to All Conditions Are Met (AND).
Next, under the Condition Requirements, set the Field to StageName, the Operator to Equals and the Value to Proposal/Price Quote.
Finally, click Done.
Note: While we have configured the flow for our proposal this way, you have many options for doing this in your own flows. For example, you could trigger the generation of a document when a Salesforce record is deleted and create a set of conditions for its generation.
-
In the Flow Builder, click the + button to add an element to the flow.
Note: the + button may be partially hidden.
-
In the Add Element panel, click the Action interaction.
-
In the New Action dialog box, select Generate Documents in the Action dropdown box.
Next, enter a Label such as Generate Proposal and paste the template ID that you previously copied into Template Id.
From the Record Id dropdown box, click $Record Opportunity.
Then select Id.
Next, scroll to the bottom of the New Action dialog box.
Set the Salesforce Delivery Method by switching on Include beside it and entering one of the following values:
- link (sends only a link to the generated document back to Salesforce)
- file (sends the entire generated document back to Salesforce)
You can also optionally change the Document Name by switching on Include beside it and entering the name. By default, the name of the document generated is the same as the template name.
Finally, click Done.
-
To save the flow, click Save.
In the Save the flow dialog box, enter a Flow Label such as Generate Proposal and click Save.
-
To activate the flow, click Activate.
Note: If you edit your flow, you need to save it as new version and then activate it.
Triggering a Salesforce flow
Once you've created a Salesforce flow for the proposal, you can generate a document from it by setting the Stage of a Sales Opportunity to Proposal/Price Quote. To do this:
-
Click the App Launcher.
In the Search apps and items... field, enter sales and click the Sales app.
-
In the Sales page, click the Opportunities tab and click on an Opportunity Name.
-
In the Opportunity page, select the Details tab and change Stage to Proposal/Price Quote, and then click Save.
Putting it all together
The following is a simple DOCX template proposal with Salesforce fields, which you can download and modify:
After you have created a template from this and copied its ID, created a Salesforce flow with the ID and triggered the flow, Inkit will generate a document similar to the following:
Note: You can also automatically generate documents from Salesforce Apex triggers.
Updated 9 months ago