# Set up Data Sync

## Set up a scheduler

Data Sync allows you to automate the process of syncing data in your app. Instead of manually performing data syncs, you can set up a Data Sync scheduler to update data automatically.&#x20;

### **1. Create a Project from resource**

To start, you need to create a project and select a resource from which you want to sync data.

<figure><img src="https://3574406564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MB_fx7PCUqvFEdrucJC%2Fuploads%2FapfP5A7otJpRlADZ3Xyq%2FScreen%20Shot%202023-08-31%20at%207.11.53%20PM.png?alt=media&#x26;token=bf7db783-54b4-42a7-93ac-a4c64d5ea51b" alt=""><figcaption><p>Steps to Create a Project from resource</p></figcaption></figure>

1. Go to Project page.
2. Click **Create Project.**
3. Fill in the Project name.
4. Select the desired resource from the resources list.
5. Click **Create Project**

### **2. Create a Workflow from Project**

Next, you'll create a workflow for the project. There are two methods to accomplish this:

Method 1:&#x20;

1. Go to Workflow page.
2. Click **Create Workflow.**
3. Select the project from the project list.
4. Click **Create** to create a new Workflow

<figure><img src="https://3574406564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MB_fx7PCUqvFEdrucJC%2Fuploads%2FLnHx4LILjiyvNKyZ5yHY%2FScreen%20Shot%202023-06-05%20at%2011.19.55%20PM.png?alt=media&#x26;token=c439d910-2aae-4041-a7de-85da24d3e4df" alt=""><figcaption></figcaption></figure>

Method 2:&#x20;

1. Open the project for which you want to sync data.
2. Click <img src="https://3574406564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MB_fx7PCUqvFEdrucJC%2Fuploads%2FOxYjHREJiNrLeHP11brS%2Fimage.png?alt=media&#x26;token=7f9286e3-5efb-4e09-98f6-d2425f15e521" alt="" data-size="line">**Request Data Sync Now**

<figure><img src="https://3574406564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MB_fx7PCUqvFEdrucJC%2Fuploads%2F4FrbBkb7qUnHYdxqpb3J%2Fimage.png?alt=media&#x26;token=cf293feb-a021-44ac-be73-8c771e86d81e" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3574406564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MB_fx7PCUqvFEdrucJC%2Fuploads%2FAOHBEz2QeYmQckrtrt7p%2FScreen%20Shot%202023-06-05%20at%2011.30.48%20PM.png?alt=media&#x26;token=7f185a34-0fbb-48c5-919b-70899872d190" alt=""><figcaption></figcaption></figure>

### **3. Set up Data Sync in Workflow**

3.1 Enter the Workflow you just created and click on the Data Sync Button beside the resource that you wanted to sync data, assuming you want to sync resource data. You can also sync project table data if you need to.

<figure><img src="https://3574406564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MB_fx7PCUqvFEdrucJC%2Fuploads%2FgBVaWWaNELAOZAxImpie%2Fimage.png?alt=media&#x26;token=f083ac44-23cf-4b52-9d34-ce02c4b9e77d" alt=""><figcaption></figcaption></figure>

3.2 Switch the status "**PAUSED**" TO "**ENABLED**" to start data syncing. A success message will pop up when the scheduler is enabled.

<figure><img src="https://3574406564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MB_fx7PCUqvFEdrucJC%2Fuploads%2FEqdkupj2u5jCfjYboLRj%2Fimage.png?alt=media&#x26;token=47b46506-5336-443e-8739-cbdcbece6a35" alt=""><figcaption></figcaption></figure>

#### 3.3 Data Sync Settings

* **Update Mode**:&#x20;
  1. **Incremental:** This mode only syncs the new or modified data since the last synchronization. It updates only the changes made to the data, resulting in faster sync times and optimized resource usage. It is useful when you have a large dataset and want to minimize the amount of data transferred during each sync.
  2. **Full Refresh:** Selecting this mode means that the entire dataset will be synced every time the scheduler runs. It ensures that all data in your app is up to date and consistent, but it may take more time and resources compared to incremental syncs. This mode is suitable when having a complete and current copy of the data is important.
* **Sync Frequency:** determines how often the data synchronization will occur.
  1. **Intraday:** update the table every specific time interval within a day. The minimum time interval is 15 minutes.
  2. **Daily:** update the table at a specific time (such as 6 a.m.) every day.&#x20;
  3. **Custom:** you can define the scheduler in a more flexible way.
* **At**: The UTC time when the data is automatically synced. Sometimes, a several-minute delay might occur, and it is normal.

<figure><img src="https://3574406564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MB_fx7PCUqvFEdrucJC%2Fuploads%2F83DUcv5oiGYz54wH9zOF%2Fimage.png?alt=media&#x26;token=029b86d2-f813-40c1-9dbe-5eb06d6d2a77" alt=""><figcaption><p>Data Sync Settings</p></figcaption></figure>

## How to check if the scheduler is running?

You can go to **`Sync History`** to check when the table was updated last time.

![](https://3574406564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MB_fx7PCUqvFEdrucJC%2Fuploads%2FHtXRxctc0PCVGOV97iI4%2Fimage.png?alt=media\&token=45d87e20-0b78-474d-b21e-a0836ed0c018)

## How to check who requests Data Sync or sets up the scheduler?

You can go to **`User Actions`** in the **`Data Sync`** page. It records actions including setting up the scheduler and requesting to sync now.

<figure><img src="https://3574406564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MB_fx7PCUqvFEdrucJC%2Fuploads%2FS591cSltjHLltJH96Ovg%2Fimage.png?alt=media&#x26;token=a63cfcf7-7a1a-41bf-9702-2e1c5d49c94c" alt=""><figcaption></figcaption></figure>

## Request to sync now

1. **Go to the table that you want to update and click the `Request Data Sync Now` button.**

<figure><img src="https://3574406564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MB_fx7PCUqvFEdrucJC%2Fuploads%2F4FrbBkb7qUnHYdxqpb3J%2Fimage.png?alt=media&#x26;token=cf293feb-a021-44ac-be73-8c771e86d81e" alt=""><figcaption></figcaption></figure>

&#x20;  **2. Specify to append rows based on which columns and click the `Sync Now` button. (The meaning of "Append new data by column" please see** [**here**](#3-set-up-a-scheduler)**)**

![](https://3574406564-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MB_fx7PCUqvFEdrucJC%2F-MaAoahkDBb4JQMD1dyB%2F-MaB-S76HaoZUK7W8mUU%2Fimage.png?alt=media\&token=1453ed8c-73a8-42d1-b90b-076d623c7df3)

&#x20;  **3. The button will show a small mark "Syncing". It may take several minutes to update the table.**

![](https://3574406564-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MB_fx7PCUqvFEdrucJC%2F-MaAoahkDBb4JQMD1dyB%2F-MaAzaxuGmGf0grC275E%2Fimage.png?alt=media\&token=1306d21f-71d5-463a-b81b-0aa3130751a6)

&#x20;  **4. When Data Sync is finished, you will see a message on the top of the page.**

![](https://3574406564-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MB_fx7PCUqvFEdrucJC%2F-MaAoahkDBb4JQMD1dyB%2F-MaB-FCZVqUxrBUxXR4H%2Fimage.png?alt=media\&token=a24e8a84-039a-4ac0-a66b-df96c7182df1)
