A Digital Form helps you to collect the required data. It allows your users to enter the data you want to process a certain request. Digital Form triggers refer to the triggers that occur through the submission of a digital form. For example, let us consider an employee expense report. An employee has submitted an expense report of $1000. After the submission, the system fetches the user-related information through an API request and follows the approval process. In this scenario, the system uses the API request. The process flow of the Digital Form Trigger is explained below.
Configure Digital Form Trigger
- After you log in to the Process App, it lands you on the Flow tab.
- On the right pane, click Digital Form under Triggers.
- On the Digital Form Trigger window, select Create New Form from the Forms drop-down list.
- On the New Form dialog box, enter the following details:
- Name – Enter a name for the digital form. For example, Expense Report
- Display Name – Enter a display name to easily identify the name.
- Description – Enter a short description of the digital form
- Click Create.
- On the Digital Form Trigger window, click Add Access Control. It lands you on the Forms page and you can add a component in the master form. You can only update Read-only, Is-Visible, and Visibility settings through access control.
- Under the HTML to embed form section, you can find the HTML code. Click Copy to copy the HTML code. You can use this HTML iframe code to embed the trigger form in your website. This is needed only if you do not use the portal and the process app is for public access.
- Click Done. You can find the trigger created on the Process Builder.
- Start to build the flow by notifying the initiator (employee).
- On the left pane, you can find the Events section. Drag and drop the Notify stencil from this section to the builder.
- Click the Notify stencil to open the Notify window.
- On the Notify window, enter the following details:
- Name – Enter a name for the notification message.
- Delivery Mode – Select the mode of communication to notify the employee.
- Recipients – Enter the email address of the employee to receive a notification. You can also use context or variables from the trigger.
- Subject – Enter the subject for the notification email.
- Compose Message – Enter the relevant text related to the notification. It also supports context and the addition of variables so that you can include them while composing the message.
- Close the Notify window.
- Make an API request to fetch the Manager details of the initiator (employee).
- On the left pane, you can find the Integrations section. Drag and drop the Connect to API stencil from this section to the builder.
- Click the Connect to API stencil to open the Connect to API window.
- On the Connect to API window, enter the following details:
- Name – Enter the name of the API request.
- Type – Select the API request type: REST or SOAP
- Integration Mode – Select the integration mode: Synchronous or Asynchronous.
- URL: Click Define Request under the URL field.
- On the Define Request page, enter the following details:
- Request Type – GET
- Request URL – https://608fd39c38473400170203a8.mockapi.io/api/v1/leaverequests (This is an example URL, not for business purposes)
- This API does not require any Header Parameters.
- Click the Test Request tab.
- Click Test on the top-right of the page. Wait for the test to be completed and you get a Status Code: 200.
- You can see an array of records returned by the API call. In the next step, values are parsed using JavaScript.
- Click Save on the top-right of the page.
- On the Define Request page, enter the following details:
- Close the Connect to API window.
- After the successful completion of the API request, the system fetches the Manager details and assigns the task (expense report approval).
- On the left pane, you can find the Tasks section. Drag and drop the Approval Task stencil from this section to the builder.
- Click the Approval Task stencil to open the Approval Task window.
- On the Approval Task window, enter the following details:
- Name – Enter a name for the approval task.
- Task Results – You can find Approve and Reject options. Choose to approve or reject the task. You can also rename these options or click Add an Outcome to add more options like On-Hold.
- Click the Notifications tab to configure the notification settings.
- Select a Delivery Mode from the drop-down list: Bot or API or Email.
- Under the Response section, select a Get Response option to send the Manager’s response. These options differ based on the delivery mode selected. If the delivery mode is email, you can get responses through a form or email. If the delivery mode is bot, you can get responses through a form or conversational experience. If the delivery mode is API, you can get responses through APIs. In this example, the selected delivery mode is email.
- Get Response through a Form – If selected, the Form URL will be inserted into the message composed in the Compose Message section.
- Get Response through Email – If selected, Buttons for the result outcomes are appended to the message composed in the Compose Message section.
- Under the Compose Message section, enter the following details:
- Subject – Enter the subject for the response mail.
- Compose Message – Enter the details of the response message.
- Click {..} to add variables to the message. You can also use Context in the message.
- Click the Assignment tab to configure the recipient settings. You can select any of the below options:
- Single Recipient – If selected, you can send the response to the recipient configured in this section.
- Enter the recipient email address in the Recipient ID field.
- Multiple Recipients – If selected, you can send the response to multiple recipients configured in this section.
- Enter recipient email addresses separated by a comma in the Recipient ID field.
- Under the Assignment Logic section, select an option:
- Assign to All – If selected, the system assigns the task to all recipients.
- Least Occupied – If selected, the system assigns the task to the recipient with the least number of open tasks.
- Group – If selected, you can send the response to a group. Only one of the recipients from the group can complete the task
- Enter the group email addresses separated by a comma in the Group ID field.
- Single Recipient – If selected, you can send the response to the recipient configured in this section.
- Close the Approval Task window.
- After assigning the task, the Manager can approve or reject the task. To perform this action, you need a logic stencil. You do not always need logic to perform this task, it depends on the use case. But, in this example, a logic stencil is used.
- On the left pane, you can find the Logic section. Drag and drop the Split stencil from this section to the builder.
- The Split stencil is added to the builder with two branches (Branch1 and Branch2).
- Click the Split stencil to open the Split window.
- On the Split window, enter the following details:
- Name – Enter a name for the split action. For example, Manager Decision.
- Branches – Edit the branches (Branch1 and Branch2) as Approved and Rejected.
- Split Logic – Select any of the below options:
- Execute all Branches – If selected, all branches are executed simultaneously.
- Execute on Condition – If selected, you can define a condition in the Define Condition section below. You can define conditions based on Process Fields, Context, and Process Context. For example, let us select Process Fields.
- Under the If condition, Select Field Value and Less than from the respective drop-down lists. In the Value field, enter $2000.
- From the Go to Branch drop-down list, select Approved.
- In the Add Else-If section, select Rejected from the Else Go To Branch drop-down list.
- Close the Split window.
- The next step is to notify the employee about the status of the expense report. Drag and drop the Notify stencil below the Approved and Rejected branches on the builder.
- Open the Notify stencil of Approved and Rejected branches and configure the notification details.
- The final step is to end the process flow.
- On the left pane, you can find the Logic section. Drag and drop the End stencil from this section to the builder.
- Click the End stencil to open the End window.
- On the End window, select any of the below options:
- End this Path – If selected, the system will end the current path and all other paths remain active.
- Terminate all Paths – If selected, the system will terminate all active paths and end the process flow.