Mapping Form Field Values to Workflow Process Variables

Posted by Dileepa Wijayanayake on Mar 14, 2015 12:40:14 PM

 

In our March 2nd blog we used the workflow process to route a form for data entry. Let’s revisit that “TestFormDef” workflow definition and look at mapping a form field value to a workflow process variable.

Open the “TestFormDef” workflow definition in the designer for editing. Drag and drop a “getFormFieldValues” step into the designer and connect the last step (routeform) to the new step. Mapping Test Form Definition

Next, let’s define another workflow process string variable called “lastName”. Select the “start” step and click in the “Variables” link at the bottom of its properties pane. Type “lastName” in the Add Variable field, select “String” for Type, and click the Add button.

Mapping Workflow Process String Variable

Click the Save button to save and close Variables page.

Click on the new “getformfieldvalues” step and configure the following properties:

Mapping Get Form Field Variables

Enter “variable.formID1” for the Variable that holds the form instance ID. In the Select form definition dropdown, select the form definition used in the instantiateform step. Now click the Mapping of fields to variables button:

Mapping Instantiate

Select “txtLastName” in the Form Field dropdown and enter “lastName” in the Variable Name field. Click the Save button on the popup and click the Save button in the step properties pane. When the Workflow Instance executes, the value in the “txtLastName” form field will be written to the process variable “lastName”. Let’s save the Definition and re-execute the Workflow Instance. Mapping Form Field

The rendered view of the task containing the form is shown above. For this example we will select Joe Simpson from the Name Lookup and then complete the task.

Now let’s render the executed process: Mapping Form ExecuteClick on the last step in the process to view the properties:

Mapping Form Field VariablesAs highlighted above, the variable “lastName” now contains the value entered into the “txtLastName” field within the form.

 

You may also be interested in reading more on the subject of Configuring a Custom Workflow Step.

A small sampling of the Workflow Technology for BPM Solutions contained within our cDevWorkflow product offering can be found here: Workflow Technology That Works.

[hs_form id="9"]

Learn more about our Process Automation & IT, QA Services or Software Development products and solutions on the Web!  Visit us at: Innovative Process Solutions

Topics: Blog, workflow process variables, forms workflow, .net forms workflow software, dynamic form, workflow forms, .net workflow software forms, forms .net workflow software, dynamic forms, form workflow, workflow form instances, Mapping Form Field Values, Mapping