# Approval Workflow

EDITable's live database connection allows for real-time data updates and synchronization. While row and column-level access permissions ensure data integrity, you can go one step further to secure your data by setting up approval workflows.

In a team, users might need management's approval before making any data changes to ensure correctness and accuracy. There can be scenarios like multiple users accidentally changing the same data, entering incorrect values, etc. All these can be managed by setting up an approval workflow process in EDITable and then selecting the approvers.

## Steps to set up approval workflow

1. Enabling Approvals in EDITable
2. Selecting approvers by specifying the method
3. Setting up the handling of approvals, if necessary

Once enabled, every change made by users undergoes an approval process before getting saved and synced to the source.

Whenever a change is made,&#x20;

:ballot\_box\_with\_check: Approvers receive an email notification about the change request made along with details such as the request ID, name of the table, database, and author who initiated it.

:ballot\_box\_with\_check: The changes are indicated in the table based on how they have been set to be handled (Persistence modes).

:ballot\_box\_with\_check: Approvers can review the log in the 'Review' tab and choose which changes to approve or reject.&#x20;

:ballot\_box\_with\_check: After approval or rejection, the user who made the change is notified via email.

:ballot\_box\_with\_check: The approver can also propose changes to the author.

:ballot\_box\_with\_check: The author can choose to make the suggested changes and send it again for review.

:ballot\_box\_with\_check: The approved changes are synced to the source.

This section explains all of the above in detail.

## **1. Enable Approvals**

You can turn on the approval workflow by following the steps below:

1. Navigate to **Settings** **-> Approvals.**
2. Toggle on the **Enable Approvals** button.

<figure><img src="https://608526116-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdpYgiTFFEktmDlcxUGTv%2Fuploads%2FiwhZZ4p7AATYQUEBlOP8%2Fimage.png?alt=media&#x26;token=418554dd-b0f4-4591-be7c-9f95b30c4b75" alt=""><figcaption><p>Enable approvals</p></figcaption></figure>

## 2. Select Approvers

The next step is to select the approvers who will review and approve any changes made to the table.&#x20;

There are three ways to select approvers.&#x20;

* Manually entering the email IDs of approvers or IDs of AD groups (Active Directory Groups)
* Configuring a rule-based system to identify the approvers
* Using a lookup table to establish the rules.

Here's a detailed guide to each method:

### **2.1. Enter the List of Approvers**

This is a straight-forward method where you will manually specify individuals who will act as approvers. This method allows you to select specific users in the workspace by typing their names or email addresses who will be responsible for reviewing and approving the changes.&#x20;

<figure><img src="https://608526116-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdpYgiTFFEktmDlcxUGTv%2Fuploads%2FOIeR6vXQvSa6ZXX8ZVjR%2Fimage.png?alt=media&#x26;token=00a74f49-fe48-4e95-92cb-23a4814a490f" alt=""><figcaption><p>Enter list of approvers</p></figcaption></figure>

### **2.2. Add Rules to Identify Approvers**

Define approvers for specific columns or records in the table based on set rules and criteria. Enter the rule name, the filter criteria, and the designated approvers for that rule. You can set as many rules as required and assign corresponding approvers for each.

Note that rules are executed in the order they are added and can be reordered.&#x20;

The detailed steps are as follows:

1. Select **Add rules to identify approvers.**
2. Click **Add Rule** to add a rule.

<figure><img src="https://608526116-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdpYgiTFFEktmDlcxUGTv%2Fuploads%2FyUyMXCuGaZxfdtguKHTk%2Fimage.png?alt=media&#x26;token=76321986-3f7c-43a6-9432-9da0db385363" alt=""><figcaption><p>Add rule</p></figcaption></figure>

3. In the pop-up, enter a name for the rule, filter criteria and approvers for the criteria and click **Add.**

<figure><img src="https://608526116-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdpYgiTFFEktmDlcxUGTv%2Fuploads%2FdcSd31oY5Mpx8cm4853t%2Fimage.png?alt=media&#x26;token=4694a156-4d5b-4f09-85b0-7b9a05d9df70" alt=""><figcaption><p>Adding criteria </p></figcaption></figure>

4. You can add multiple filters/criteria within a rule and combine them using AND or OR operators as below:

<figure><img src="https://608526116-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdpYgiTFFEktmDlcxUGTv%2Fuploads%2FWysbBP4nNyCVaDZIrnoo%2Fimage.png?alt=media&#x26;token=070e0479-532b-4a2f-8e10-80d1a3418aae" alt=""><figcaption><p>Adding more than one filter criteris</p></figcaption></figure>

5. To delete a filter criteria, use the bin icon.&#x20;

<figure><img src="https://608526116-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdpYgiTFFEktmDlcxUGTv%2Fuploads%2FZqlkRk7LZX8ccNR9yKGR%2Fimage.png?alt=media&#x26;token=c090ef7a-90a8-462a-b236-9e9406d2d1af" alt=""><figcaption><p>Deleting a filter criteria</p></figcaption></figure>

6. After clicking **Add**, you can find the rule added to the list of rules. You can add more rules by selecting **Add Rule.**

<figure><img src="https://608526116-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdpYgiTFFEktmDlcxUGTv%2Fuploads%2FUasZXp5TcFEQ69iGDblR%2Fimage.png?alt=media&#x26;token=772c8768-2d1d-45b3-a28c-780154c0388f" alt=""><figcaption><p>Rule added</p></figcaption></figure>

7. Use the options as highlighted below to edit, re-arrange, or delete a rule.

<figure><img src="https://608526116-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdpYgiTFFEktmDlcxUGTv%2Fuploads%2FLE4TkmqBWM5Hp4qSVQzS%2Fimage.png?alt=media&#x26;token=ea0a357c-2335-4d59-8c64-427bb7c71fcf" alt=""><figcaption><p>Edit/delete rules</p></figcaption></figure>

8. **Default Approver**: In the final step, add one or more default approvers who will approve the changes that do not meet the above-configured rules/criteria. Click **Save** and you are good to go.

<figure><img src="https://608526116-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdpYgiTFFEktmDlcxUGTv%2Fuploads%2F9maF2rmNMlqutQrbEXg3%2Fimage.png?alt=media&#x26;token=13196718-6832-4248-8f60-024067056e9d" alt=""><figcaption><p>Default Approvers</p></figcaption></figure>

### **2.3. Lookup Rules from a Table**

In this method, you can configure the rules and approvers list by looking up data from another table. The options are explained below:

* **Table**: This dropdown menu displays a list of tables in the connection. Select the table from which the approvers list is to be looked up/fetched.
* **Approvers**: Choose the column containing the approvers' email IDs.
* **Conditions**: Map columns from the lookup table to the corresponding columns in the source table to join the tables. You can set multiple conditions (join multiple columns) as needed.

For example, let us assume each brand in the lookup table has a person-in-change with their corresponding Email IDs added in the Email ID column. By mapping the columns 'brand' from both tables, we allow the corresponding approvers' email IDs to be fetched for each brand.&#x20;

* **Default Approvers**: Specify the default approvers to approve other changes that do not involve the above set conditions.

<figure><img src="https://608526116-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdpYgiTFFEktmDlcxUGTv%2Fuploads%2FosR7jLYuIB3s9XWKGmPo%2Fimage.png?alt=media&#x26;token=d64766d4-d77a-4b4c-b804-674d21874379" alt=""><figcaption><p>Look up table for rules</p></figcaption></figure>

Click on **Preview Rules** to view the approvers list for each brand. In the example below, we have the same approver for all brands.

<figure><img src="https://608526116-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdpYgiTFFEktmDlcxUGTv%2Fuploads%2FDrgsNl2WKr832h9gRln1%2Fimage.png?alt=media&#x26;token=21825e0b-8c50-42ab-9a26-b1002584ac93" alt=""><figcaption><p>Preview Rules</p></figcaption></figure>

You can use the **Sync Rules** option to sync the connected lookup table to fetch the latest data. The last sync details and the status can also be seen.

## 3. Handling Approvals - Persistence Mode

In this section, you can specify your preferences for managing approvals. There are two options available.

### **3.1. Require Approval Before Saving**

In this method, users must get approval before saving any changes to the data. This is the default mode.

<figure><img src="https://608526116-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdpYgiTFFEktmDlcxUGTv%2Fuploads%2FbaYuBu7bYN07kmfreltb%2Fimage.png?alt=media&#x26;token=8952de4a-1839-454f-9307-27b24e63036c" alt=""><figcaption><p>Persistence mode</p></figcaption></figure>

After making changes, clicking on **Save** opens the pop-up below, where you can add the description and priority of the change. Click **Submit** to send them to the approver.

<figure><img src="https://608526116-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdpYgiTFFEktmDlcxUGTv%2Fuploads%2FByVgnGgDFhxvKVMohQnp%2Fimage.png?alt=media&#x26;token=e2db27ae-6080-4c5a-8eef-ecab42525c2e" alt=""><figcaption><p>Send for approval</p></figcaption></figure>

The table below illustrates the changes made, highlighted in yellow. Hovering over the marked areas displays detailed information about the changes.

<figure><img src="https://608526116-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdpYgiTFFEktmDlcxUGTv%2Fuploads%2FavXqn4TcgcmbcXKkVDlL%2Fimage.png?alt=media&#x26;token=e094911d-7d4c-45ec-a5a2-6f5d99ee730f" alt=""><figcaption><p>After submitting the changes</p></figcaption></figure>

### **3.2. Save with Pending Approval Status**

In this option, the changes are saved and synced to the database with a 'pending review' status flag. The rows marked as pending are sent for review. Once approved, the status column will be updated to reflect the approved flag, and the data will also be updated accordingly.

1. Choose any existing column from the table to reflect the status flag field. We have used the column 'Active' in the example below, where the status is recorded.
2. Enter the required text to be displayed for each state, such as pending for review, approved record, and rejected record.&#x20;
3. Click **Save.**

<figure><img src="https://608526116-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdpYgiTFFEktmDlcxUGTv%2Fuploads%2FnI4L5PL7CV7OTdCCssWy%2Fimage.png?alt=media&#x26;token=a55dc81c-8bbb-4b24-af13-4606dcd9fddb" alt=""><figcaption><p>Configuring the text for status flags</p></figcaption></figure>

After making the changes to the table, you need to click on **Save** to send it for review. This saves the data with the status column.

<figure><img src="https://608526116-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdpYgiTFFEktmDlcxUGTv%2Fuploads%2FalvmhLmgvRUDujtOZI52%2Fimage.png?alt=media&#x26;token=375aa47b-d3e3-48a1-b637-81efb6ba77f5" alt=""><figcaption><p>Save and proceed for approval</p></figcaption></figure>

The saved changes are displayed as below, with the status flag: 'Pending':

<figure><img src="https://608526116-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdpYgiTFFEktmDlcxUGTv%2Fuploads%2FTG9OFcSM4fLF1DOvpZEY%2Fimage.png?alt=media&#x26;token=37fd4f71-1b50-420f-ad82-f8ff0a259b16" alt=""><figcaption><p>Saved changes with the status</p></figcaption></figure>

In the next section, we will discuss the process flow of review and approval in detail.
