> For the complete documentation index, see [llms.txt](https://saral.sunbird.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://saral.sunbird.org/learn/features/auto-sync.md).

# Auto Sync

Auto Sync from Saral App to Saral backend

Saral App is used in the field to collect data, but the challenge is in few remote places there is no internet connectivity all the time. So once useres login to Saral App, scanned data is initially stored in mobile local storage. Users can manually sync data to Saral backend by clicking on the `Save All Scans` button. `Auto Sync` feature polls data in local storage at a frequency and pushes it to the backend.&#x20;

This feature is available from `v1.0.0-beta.5` release and above.

![](https://811030052-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLe89Gzl6JNQ9inpB8sRg%2Fuploads%2FrVYTOzC3ikHWgiHJyR8o%2Fsync-1.jpeg?alt=media\&token=56c2ead1-5bbf-4fa4-a920-be0c46b96929)![](https://811030052-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLe89Gzl6JNQ9inpB8sRg%2Fuploads%2F3cAycVcIMYI2bxO68fJN%2Fsync-2.jpeg?alt=media\&token=1cba5366-7f28-490a-b494-e56f9ea69462)

&#x20; ![](https://811030052-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLe89Gzl6JNQ9inpB8sRg%2Fuploads%2Fyb6gle3fDVtIibaWbemT%2Fsync-7.jpeg?alt=media\&token=ab8683f9-6373-428f-a90f-ea193d1970bc)![](https://811030052-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLe89Gzl6JNQ9inpB8sRg%2Fuploads%2FG48Hw0k9oo2NpQGvMwch%2Fsync-3.jpeg?alt=media\&token=1b48f6fc-a714-467a-a2b5-27df6c99c6f5)

Auto Sync can be controlled by following configuration:

```
autoSynch - boolean
autoSynchFrequency - integer
autoSyncBatchSize - integer
```

`autoSynch` is a boolean property in `/schools/login` API response. if it's set to true then Auto Sync process will be enabled.

`autoSynchFrequency` is frequency at which auto-synch to be executed.&#x20;

`autoSyncBatchSize` is batch size for auto-sync functionality. Auto-sync triggers based on number of records available in local storage. if its minimum of `autoSyncBatchSize` and other configuration matches, auto sync to backend will be triggered in mobile app. Default value if not set is 10.

`/schools/login` API response with `autoSynch` and `autoSynchFrequency` configuration reference.

```
{
"school" : {
    "storeTrainingData" : true,
    "name" : "Dummy school 4",
    "schoolId" : "u002",
    "state" : "up",
    "autoSynch" : true,
    "autoSynchFrequency" : 9000,
    "autoSyncBatchSize": 20
}
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://saral.sunbird.org/learn/features/auto-sync.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
