This article will help you understand to enable separate submission using the workflow
Let us have a look at the following video to understand workflows for separate submission:
Workflow Separate Submission
This is useful only in case you have used Form MultiRow Control in your form. Typically in scenarios where you have multiple approvals or tasks required that need to be done separately rather than approving/rejecting all at once.
Consider an example to add a Workflow to a Reimbursement Form.
Now to activate this Submit records separately option, Open Workflow screen, and click Edit (Pencil Icon) as shown above. It will then open an Edit workflow screen that has a checkbox option - “Submit records separately”.
Click to select the checkbox. That’s It, now all the values in the Form Multirow control will be executed as a Separate Workflow rather than Iterating through it in the same workflow instance.
Further, if you want to see how this impacts the workflow lets have a look at the example below.
Consider a Reimbursement application in which the user applies for Expenses which should be reimbursed once it is approved by the user’s manager. The user’s Manager can be updated in User’s Sheet. User Sheet can be opened by Clicking on User Hierarchy option under Users tab in Studio Dashboard.
The App is setup using Form Multirow control as shown above.
We have created a New Sheet called Exp_Details_doc with columns added as shown above. Basically, we are maintaining this sheet to store user expenses details in Columns - Name ExpenseType , Exp_Amount , Comment columns.
Workflow is set up as shown above. You would use the Update Sheet Task > Insert Record and bind the columns to the controls.
Once everything is set up correctly, make sure that you have enabled “Submit records separately” checkbox .
Now let us run the form and see how the record gets added to the sheet. As we have added Form Multirow control you will note that the expense records for the same person would be added separately in multiple rows.
Sheet as updated from the workflow
As you can see in the sheet the Name which we entered only once outside the Form MultiRow control and the details for expenses we added twice as a part of the Form Multirow control have been submitted separately to the sheet.
Depending on your use case, you can choose to enable/disable “Submit records separately” option for Workflow.
Iterate task with Form Multirow
We have seen how we can add records separately in a workflow. The action is applied for the entire workflow. So in case you have an update record as well as an insert record tasks separately defined, the records would be submitted separately in both tasks.
Now if we want to just include submission only for a specific task like for example the Insert record task, we can make use of the Iterate this task available within the specific task. Let us take the same example we used above. We would also use the same workflow. The only change you need to note is to **remove the checkbox selection ** done for Submit records separately and then Save Workflow.
Once this is done, click to edit the Task. Under Task Iteration Information set Iterate this task to ON. Now add the Group data source columns where you would specify the records from the Form Multirow control that would be added as multiple expenses for the same person.
Other things remain the same i.e selecting the task type as Insert record and binding the columns and control.
Now if you execute this you can see that multiple rows are added for the same person.
The records are updated in the sheets as shown below.
Iterate task with Dropdown with Type as Multiselect
Let us understand the Iterate task in a different scenario. Let us add a new form with a Dropdown for Name with type Multiselect, Dropdown with type Single select for Expense Type, Numeric control for Expense amount and Text control for Comment. Add a submit button. We will use the same sheet used above which was Exp_Details_doc with Columns - Name ExpenseType , Exp_Amount , Comment columns.
Now add a new workflow with Update sheet task. Add a task name and go to the Task Iteration information. Here you would see that the Group data source has only the Dropdown with Multiselect type listed. This is because now the iteration would be based on multiple names that we select and data would be added common for the expense type, amount and comment columns.
Now add the sheet to be updated and bind the controls to the columns.
Link the workflow to the Submit button and now if you run this form, you would be able to select multiple names and add the common details for the remaining columns.
The records added to the sheet would be as shown below. Common data for the multiple names selected using the Multiselect type Dropdown control.