# Auto Sync

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.

![](/files/i3qJObT4UfeJG5sfNISx)![](/files/m4fuLEmUUy473fbzEe8p)

&#x20; ![](/files/lDqCtaFG7VZFmxHovYtJ)![](/files/oFc39mjGHBQc32bHAzYw)

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: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

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

The question should be specific, self-contained, and written in natural language.
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.
