Setting form field values using a process step

Learn to set the form fields within the process

Last published at: May 8th, 2024

To achieve this, let's use the “setFormFieldValues” step in the process definition. 

Let’s use the form definition “TestFormFile,” which looks as follows:

 

Let’s use the process definition “TestFormFileDef,” which looks as follows:

 

Let's drag the “setFormFieldValues” step to the designer and connect to the last step of the process. The red alert sign indicates the step property configuration is incomplete. The context is to set/modify the form field value from within the process.

 

 

Click on the “setFormFieldValues” step to configure the Settings properties. Provide the variable reference that holds the form instance ID. Click on the button to configure the mapping of fields, and a popup window will appear. Select the “Comments” form field and provide a value. Click on the Save button to confirm the configuration.  

 

Save the changes to the step and the process definition.   

 

Let’s generate and execute a new process instance to view the change to the form instance name. 

 

Then, you have to navigate to the Engage—Tasks page, as shown below. Select the Instances search filter and select the process instance from the drop-down list. The incomplete task assigned to the user is shown below. You may also search for the task using the Search textbox. Click on the task to open.

 

When filling out the form, give the value of “Admin-Simpson” for the entire name field. When the form fill-up is complete, submit it. Note: The Comments textbox is left empty as it's read-only, and this field value is set within the process using the “setFormFieldValues” step. 

 

The following is the executed path for the process instance. To let you know, the process instance is complete. 

 

You can navigate to the form instances to view the list of form instances. The list should contain a form instance called “Admin-Simpson” since that was the value given on the form for the “txtFullName” field. Select this form instance and click the View - Render menu option to view the form values. 

 

The form instance is rendered on the new page, and as observed, the Comments field value is set during the process using the “setFormFieldValues” step.