Moving data between databases or spreadsheets inside AppSheet shouldn't feel like open-heart surgery. Yet, when you need to duplicate records, migrate sources, or split a bloated table into structured child-parent relationships, default methods often fall short. Whether you're transitioning a prototype from a personal Google Drive account to an enterprise SQL server or duplicating an entire app database for testing, getting the data transfer right determines whether your custom app scales smoothly or collapses under duplicate keys and broken references.
AppSheet applications rely heavily on the underlying data structure. When you copy rows or shift tables without accounting for key columns, unique IDs, and dependent child tables, you risk orphaned records and broken syncs. Let's break down how to execute clean, reliable data transfers without losing your mind or corrupting your datasets.
Preparing Your Source and Destination Data
Before touching AppSheet's editor or writing any automation bots, you need your data layers primed. Moving data blind often results in sync errors, missing columns, or mismatched data types that halt app execution.
Audit Column Structures and Data Types
Your destination table must mirror the logical structure of your source, especially for key columns and foreign keys. If your source table uses a column designated as Key with an UNIQUEID() initial value, copying those exact rows into a new table requires careful handling.
- Match column names precisely if you plan to swap data sources inside the AppSheet editor.
- Verify that EnumList and Ref columns point to valid key values in the destination database.
- Check date, time, and decimal formatting across both platforms to prevent conversion truncation.
Cleanse Existing Records
Data transfer is your best opportunity to purge old test records, duplicate entries, and junk data. Run a preliminary audit on your source sheet. Remove rows where mandatory fields are blank, as AppSheet's strict validation rules will reject them upon import. If you're moving from a flat-sheet model to a normalized relational database, separate your flat columns into distinct tables before initiating the transfer.
Method 1: Manual Export and Import via CSV
For one-off migrations, backups, or moving test environments to production, CSV export and import remains a straightforward baseline approach.
Exporting from AppSheet
You don't always have to dig into your Google Drive or database host to grab your data. AppSheet allows you to export current table views directly.
- Open your app in browser preview or use the published client.
- Navigate to the view containing the data you want to transfer.
- Use the built-in menu or action to download or export the view data as a CSV file.
Importing and Re-linking in the Editor
Once you have your CSV file ready and uploaded to your new destination (such as a new Google Sheet or SQL database), you need to point AppSheet to the new source.
- Open the AppSheet Editor and navigate to Data > Tables.
- Select the table you want to update and expand its settings.
- Locate the source path or worksheet name and update it to point to your new destination file or table.
- Click Regenerate Structure to force AppSheet to re-read the columns and update field mappings.
Note: Always regenerate structure after swapping data sources. Failing to do so causes AppSheet to cache old column schemas, resulting in missing field errors during user syncs.
Method 2: Automating Data Transfer with AppSheet Bots
If your workflow requires regularly copying data from one table to another—such as archiving completed orders or duplicating active projects into a historical log—manual CSV transfers won't cut it. You need an automated AppSheet Bot.
Configuring the Event
Set up a bot that triggers whenever a specific condition is met, such as when a status column changes to "Archived" or a new record is added.
- Go to Automation > Bots in the AppSheet editor.
- Create a new bot and set the Event to trigger on Data Change (Adds and Updates).
- Specify the target table and set a conditional filter, like
[Status] = "Archived".
Building the Process and Task
Instead of relying on legacy workflow rules, modern AppSheet bots use processes with explicit step definitions.
- Add a step to your bot and select Run a data action.
- Create a new action of type Data: add a new row to another table to-be-specified.
- Map the columns of your source table to the corresponding columns of your destination table using AppSheet expressions. For example, set the destination
[Order_ID]to[Order_ID]and[Customer]to[Customer]. - Optionally, follow up with a second action to delete or mark the original row as processed if you are executing a true migration rather than a duplication.
According to Google Cloud's AppSheet documentation, utilizing native data actions within automated bots ensures that security filters and user permissions are respected during automated record manipulation.
Handling Relational Data and Unique IDs
The biggest trap during data transfer is mishandling parent-child relationships. When you copy a parent row, its underlying child rows (connected via a Ref column pointing to the parent's key) will break if their foreign keys don't match the new parent's generated ID.
Preserving Parent-Key Integrity
If you generate new keys during a migration using UNIQUEID(), your child rows will point to dead identifiers. To prevent this:
- Retain Original Keys: When copying records for backup or staging migration, copy the exact
Keyvalues from the source into the destination rather than generating new ones. - Batch Migrate Parents First: Always import or copy parent tables completely before processing child tables. This ensures the foreign key references find active matches upon validation.
- Use SELECT Expressions for Verification: Before running bulk copy actions, build a temporary deck view filtered by
ISNOTBLANK([_THISROW].[Ref_Column])to verify that all relationships remain intact.
For deep dives into relational database design principles that apply directly to low-code tools, review the PostgreSQL Documentation on Table Relationships to understand how foreign key constraints protect data integrity.
Common Mistakes and How to Avoid Them
Even experienced creators run into recurring roadblocks when shifting data across platforms. Watch out for these pitfalls:
- Ignoring Sync Lockouts: Bulk copying thousands of rows via external scripts while users actively sync their mobile devices can lock your database. Always perform large data transfers during scheduled maintenance windows.
- Forgetting AppSheet Formula Dependencies: If your source sheet contains calculated columns or spreadsheet formulas (like
ARRAYFORMULAin Google Sheets), copying raw values over will break those calculations unless you recreate the formulas in the destination sheet or convert them to AppSheet virtual columns. - Neglecting User Permissions: Moving a table to a new database file often resets sharing permissions on Google Drive or cloud storage. Verify that your app's service account or users retain read/write access to the new destination immediately after the transfer.
Frequently Asked Questions
Can I copy data from an AppSheet app to a completely different database type?
Yes. You can migrate your data source from a Google Sheet to a SQL database (such as MySQL, PostgreSQL, or SQL Server) by exporting the sheet data into SQL insert statements or CSV files, importing them into the database, and then swapping the data source connection inside the AppSheet editor.
How do I stop AppSheet from generating duplicate IDs when copying rows?
By default, if your key column uses UNIQUEID(), AppSheet generates a new identifier whenever a row is created. To preserve original IDs during a transfer, ensure your copy action explicitly maps the source key column to the destination key column without wrapping it in an ID-generating expression.
What happens to existing image and file attachments during data transfer?
Image and file columns in AppSheet store file paths relative to your app's default file location (usually a folder in Google Drive). If you transfer rows to a new table, the file paths remain valid only if you also move or copy the underlying file folder structure to the corresponding path expected by the new data source.
Why am I getting schema mismatch errors after changing my data source?
Schema mismatch errors happen when AppSheet's internal table cache doesn't match the columns in your new data source. Fix this immediately by navigating to Data > Columns, clicking on the affected table, and clicking Regenerate Structure.