This topic will walk you through how to automatically refresh Salesforce-mapped data in an Ironclad workflow. This includes how to create a screen flow and add a page action.
The most simple way to use the sync action is to put it behind a custom button in certain object page views in Salesforce. This allows your users to manually sync data from Salesforce objects to the mapped Ironclad workflow. You can set this up by creating a screen flow to perform the sync, and then adding a button to the necessary record page view to allow the user to trigger the flow.
For the remainder of this topic, we are going to assume that this flow will be triggered from an opportunity record, but this approach can be adjusted to work with other object types as well.
Create a Screen Flow
- Create a new flow. For the Type, select Screen Flow.
- Create a new Flow variable to store the ID of the opportunity record. We named our variable “recordId” with a type of “Text”, and we’ve tagged this variable as “Available for input”. The “Available for input” option is required to allow the value of this variable to be passed into the Flow. In our case, the record ID is going to be passed in by our page view action when we configure it below. The naming of this variable is important, since we are going to connect this to a page action on the Opportunity page, and the record ID is always passed from those actions using the name “recordId”.
- You can continue with the Ironclad Sync action, but we recommend verifying that there are valid workflows to sync first. To do this, create a numeric variable, “WorkflowCount”, to store the number of eligible workflows on the opportunity.
- With these two variables created, we add a “Get Records” element as the first element of the flow. This element uses the “recordId” value to get all eligible workflows related to the opportunity. In the screen below, we call the collection variable generated by this element “Related Workflows”. Here, we assume that you have already configured lookup fields from theIronclad Workflow object to your related objects such as Opportunity. In this example, the lookup field on Ironclad Workflow is named “Related Opportunity”, with a field ID of "Related_Opportunity__c". The corresponding field in your Salesforce environment may have a different name.
- Note that we are getting all Ironclad Workflow records whose “Related Opportunity” field matches the target record ID, and we’re also checking that the workflow status field is “Review”, because this is the only stage when a workflow can be updated from Salesforce. We’ve also set the variable to collect all records that match.
- After the Get Records element in the Flow, create an Assignment element to take the number of workflows from the “Related Workflows” collection and assign it to the “WorkflowCount” variable we created above.
- Add a Decision element to check the number of eligible workflows, and if there are more than zero, go ahead with the sync.
- Add the Ironclad Sync action to the flow and connect it to the “Sync needed” outcome from your decision.
Add a Page Action
With the Flow in place, you must add a sync button to the Opportunity page view to allow users to execute the Flow.
- Navigate to Setup > Object Manager > Opportunity. Click Buttons, Links, and Actions located in the left panel.
- Create a new action. Choose Flow for the Action Type, and then select your new Flow. Label your action Sync to Ironclad. Define the Label as Sync to Ironclad. Define the Name as Sync_to_Ironclad. Click Save.
- In the left panel, click Page Layouts. In the page layout editor, click on the Mobile and Lightning Actions section and drag the Sync to Ironclad action to Mobile and Lightning Actions list.
- Users that open an opportunity using that page view now see the button to synch any Ironclad workflows tied to the opportunity back to Ironclad.