# Backup/Restore your Local Table by Email

**URL:** <https://community.thunkable.com/t/backup-restore-your-local-table-by-email/1838977>\
**Category:** Tutorials and DIY Guides\
**Tags:** community, data-source, intermediate, tutorial, email\
**Created:** [April 19, 2022, 6:20pm UTC](https://community.thunkable.com/t/backup-restore-your-local-table-by-email/1838977 "2022-04-19T18:20:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [April 19, 2022, 6:20pm UTC](https://community.thunkable.com/t/backup-restore-your-local-table-by-email/1838977/1 "2022-04-19T18:20:23Z")

</div>

There are situations that all you need for your app to work is a local table to store some data for your app and you do not need the mobile to be connected to the internet all the time.

But, what if the user had to reinstall the app? All data in the local table is lost and there is no option to even back it up before reinstalling the app.

This demo uses the `Email share` component to save the data in an email message so that it can be retrieved later.

Of course, you can choose to use `Google Apps Script` to automate the email process but this is beyond the scope of this tutorial.

The demo app is a simple single screen app with a DVL showing the content of the local table.

- The `Backup` button will loop through the rows in the table making a `JSON` string and once done will send this string to a designated email.
- The `Clear` button will delete all rows in the local table.
- The `Restore` button will ask the user to paste the JSON received by email in the `Text Input` field to use it to repopulate the local table again.
- For ease of testing, I have provided a variable with **sample data** so one can use it to test the restore process.

> **[Thunkable](https://x.thunkable.com/projectPage/625ec4ec191f060012a6802b)**

Code Blocks:

- Converting table rows to JSON string  

- Send JSON rows to email  

- Restoring data to local table  

- Making sure the user pasted the JSON  

- Verifying the JSON to be valid

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 1:13pm UTC](https://community.thunkable.com/t/backup-restore-your-local-table-by-email/1838977/2 "2024-11-08T13:13:21Z")

</div>


