Introduction:
The Retrieve Business Process Variables activity pulls data from variables in a processed form. It also allows you to select a specific Instance and Submission ID to pull variables from a previously ran form process.
Use Cases:
Workflow missed saving data to SQL when a form was processed.
Data is incorrectly routed to SQL from multiple forms.
Testing a workflow that is collecting specific data from a large number of fields in a form.
Option 1: Retrieve form variables from one form Instance and Submission
Create or copy a current workflow process that collects data from a form.
Select the wheel on the Retrieve Business Process activity.
Enter in the Instance ID and Submission ID for the form that you want to retrieve data from. *You can find the Instance ID in Monitor. Select the Instance Name to get the Submission ID.
Run the workflow to collect the form variables again to use in other activities of your workflow.
Option 2: Retrieve form variables from multiple forms Instances
Create a table in SQL to store each separate Instance and Submission ID.
Previously ran instances can be found in the Forms Databases in [LF_Forms].[dbo].[cf_submissions].
Query the Instance and Submission IDs you want to rerun.
Ex: to query by Process ID, join table [LF_Forms].[dbo].[cf_bp_main_instances] on the bp_Instance_id column
Create a new table to store the values for Instance ID and Submission ID that will be used in the Retrieve Business Process Variable step of workflow. Insert the values into the new table. *You should never query directly from the Forms DB to run a Workflow.
Create or copy a current workflow process that collects data from a form.
Add a Custom Query activity to pull the Instance and Submission ID values from the SQL Table
Add a For Each Row activity to the Custom Query to capture each row to add to a token.
Add Assign Token Values activity to collect each Instance and Submission ID from the created SQL table.
Select the wheel on the Retrieve Business Process activity.
Enter in the Instance ID and Submission ID token names in Process Instance fields.
Use the collected form values in other activities of your workflow within the For Each Row activity.
Conclusion
This technique can be used for a variety of reasons when a workflow is not able to complete activities with the necessary form values. I use Option 1 often when testing workflows that pull data from long forms that require a lot of field values. However, this tip has also saved me when workflows terminated due to server outages during a high-volume submission window.