top of page
schooloffiche

How to Retrieve Form Variables from Any Completed Forms Instance Using Advanced Properties



Know how to make workflow work for you

 

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


  1. Create or copy a current workflow process that collects data from a form.

  2. Select the wheel on the Retrieve Business Process activity.

  3. 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.

  4. Run the workflow to collect the form variables again to use in other activities of your workflow.

Advanced setting in Retrieve Business Process Variables

Option 2: Retrieve form variables from multiple forms Instances


  1. Create a table in SQL to store each separate Instance and Submission ID.

  2. Previously ran instances can be found in the Forms Databases in [LF_Forms].[dbo].[cf_submissions].

  3. Query the Instance and Submission IDs you want to rerun.

    1. Ex: to query by Process ID, join table [LF_Forms].[dbo].[cf_bp_main_instances] on the bp_Instance_id column

  4. 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.

  5. Create or copy a current workflow process that collects data from a form.

  6. Add a Custom Query activity to pull the Instance and Submission ID values from the SQL Table

  7. Add a For Each Row activity to the Custom Query to capture each row to add to a token.

  8. Add Assign Token Values activity to collect each Instance and Submission ID from the created SQL table.

  9. Select the wheel on the Retrieve Business Process activity.

  10. Enter in the Instance ID and Submission ID token names in Process Instance fields.

  11. Use the collected form values in other activities of your workflow within the For Each Row activity.


Example workflow setup to query multiple form instances and submissions
Create tokens of queried instance IDs and submission IDs


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.

14 views
bottom of page