A dynamic approver is defined using a SQL query that selects the appropriate approver based on the ID Number of the user who originally submitted the document. Using dynamic approvers means the person approving the form can be different for each individual form submission depending on who submitted the form. For example, you can have a student's form submission sent to a specific advisor for approval.
Dynamic approver queries should only contain one column labeled 'HostID'.
The tag "@@SubmitterHostID" is used to reference the user who originally submitted the document. If the user is a guest user, "@@SubmitterHostID" will return "0". If using this dynamic approver in a public form, your query should consider the scenario when the original submitter does not have a host ID. You may also use "@@Document ID" in this view as well to reference the unique identifier of the document. Data point values can also be used within this query to supply values entered during the original submission.
Create a dynamic approver query
1. Navigate to the Workflow feature.
2. Click on a Workflow track. The track details appear.
3. From the Workflow toolbar, click the Site Administrators drop-down and select Dynamic Approvers.
4. To add a dynamic approver query, click the green plus icon next to the Approver drop-down list. The rest of the fields become enabled.
5. In the Name field, type the name of the dynamic approver query. This will be the name you see when you select the query to add it to a Workflow stage.
6. From the Use Database drop-down, select the database that the query will pull from.
7. In the Approver Query field, type in the SQL query that will determine the dynamic approver. Each dynamic approver query can only have one column labeled 'HostID' and should only return one row.
8. Click Save Query.
Add a dynamic approver to a Workflow stage
Dynamic approvers can be added to a stage of a Workflow track. You must first create your dynamic approver query before you add it to a stage.
1. From the Workflow instance, select the Workflow track. The track details appear.
2. Click on the stage for the Workflow track you would like to add the approver to. The pop-up with the stage details appears.
3. On the Approvers tab, select the Dynamic option for the Approver Type.
4. From the Approver drop-down, select the dynamic approver query from the drop-down list.
5. Click Add. The dynamic approver is added to the list of approvers.
6. Click Save.