# 16. Approval workflows

Inforiver Matrix is the best solution for collaborative planning and reporting in Power BI. When multiple people update the same report, approvals are essential for maintaining data integrity. You can set up custom approval workflows in Inforiver using built-in scripts or leverage the intuitive user interface.

When a data input or forecast value is updated, you can trigger actions like sending a notification email or setting a value in a related field. This feature comes into the picture when you need to set up an approval workflow for values changed in the report: a report user updates a value, an approval/notification email is sent to their manager, and the manager can approve or reject the update by selecting the appropriate status from the manager approval dropdown. 

### 1. Using scripts

Data input dropdowns have an **On Change Formula** section where you can specify the actions to be triggered when a user selects an option.

Let's look at the Tax Rate report. After a user enters/updates a value in the TaxRate data input field, they should manually change the ManagerApproval status to ‘Submitted.’ In the ManagerApproval single select, we’ve listed the actions for each status change in the **On Change Formula** section. &#x20;

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2F6EeScVvY0tcrAyeHQXpK%2Fimage.png?alt=media&#x26;token=b2601d60-c8a1-4356-9d0b-2d2bb7698eca" alt=""><figcaption><p>On Change Formula section</p></figcaption></figure>

* The **SETVALUE** function can assign a particular value to a related cell. For example, when the ManagerApproval status is ‘Approved,’ the DirectorApproval status should change to ‘Pending.’ Notice how the DirectorApproval status automatically changes based on the manager's approval.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2F3DgS3SJVinvHG1UlOK7g%2F6.4.3.%20setvalue-formula-gif.gif?alt=media&#x26;token=416ed9e6-a4a6-4d0e-a89d-6ea1387e340e" alt=""><figcaption><p>Set value function</p></figcaption></figure>

* The **SENDMAIL** function will trigger email(s) to the specified recipients. You can optionally provide an email subject and a summary, which will be used in the body of the email. The email body will also contain the details of the updated values. &#x20;

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FlMt4BoRBUGNUwxibv18f%2Fimage.png?alt=media&#x26;token=40d830f1-aecd-45ef-898d-c35bd95994c9" alt=""><figcaption><p>Sample email triggered usig the SENDMAIL function</p></figcaption></figure>

### 2. No code approval workflows

Not a fan of scripting? You can easily create approval workflows with the Setup Approvals user interface. Navigate to Display Settings > Approval Workflow > Setup Approvals.

**STEP 1:** Enter the name of the dropdown and add or edit options as required.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2F2MHPmvjG5hAAQ9vYmSmt%2Fimage.png?alt=media&#x26;token=6f5f18ec-4434-41b9-96e8-dcbc11e98dc6" alt=""><figcaption><p>Adding and editing options</p></figcaption></figure>

**STEP 2:** Specify the email IDs that are authorized to update the status in the dropdown. In this case, the ManagerApproval single select dropdown.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FeWUDqp9lOzPdTYB9j2Cj%2Fimage.png?alt=media&#x26;token=e4ea17d0-bd17-45a4-8332-1df8a8eb2d8e" alt=""><figcaption><p>Enter authorized email IDs</p></figcaption></figure>

**STEP 3:** Click on **Add Workflow** to specify the actions to be triggered for each status change. Use the **Set Value** and **Send Email** options to notify a manager/associate and to change the status of a related dropdown.&#x20;

In this example, when the ManagerApproval is changed to 'Approved', an email is sent to the specified email ID, and the DirectorApproval status is automatically updated to 'In Review'.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FhMQh9gyeW7FLtoAMaqZP%2Fimage.png?alt=media&#x26;token=2c649f45-ff29-4ccd-8dd8-bcde6826fbe3" alt=""><figcaption><p>Creating workflows</p></figcaption></figure>

Repeat this step until all the required workflows have been created.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2F17ylPzVRsa4fEy8y3LOy%2Fimage.png?alt=media&#x26;token=a97f8b02-ffc4-4c01-ae94-6181c8b1eda1" alt=""><figcaption><p>Workflows created</p></figcaption></figure>

**STEP 4:** You'll notice that Inforiver automatically creates the single select data input fields when you save the approval workflow.&#x20;

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FoX56puZZ3TQsAOWBD9bR%2Fimage.png?alt=media&#x26;token=dd491656-8241-438a-ab48-befc2676bb0f" alt=""><figcaption><p>Single select fields with underlying scripts are created automatically by Inforiver</p></figcaption></figure>

Based on the workflows set up in STEP 3, the status of related dropdowns will get updated automatically and email notifications will be sent out.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2F7wUVeJh8mHSVk3sEviKu%2FUntitled%20Project.gif?alt=media&#x26;token=f2f2f53d-f1af-486e-b2f6-848ad822e6fc" alt=""><figcaption><p>Staus changes for approvals</p></figcaption></figure>
