Search code examples
google-app-maker

How to import data with Relations from Sheets


Is there a way to import data into an app from Google Sheets that includes importing relations? The documentation I found mentions the following:

You can import all data in a Sheet into a model, adding the imported records to any records that are already present. The import process preserves any relations that exist.

If I select to import All Models and Relations data below, how do I need to have the Sheets file structured (in terms of column names, etc.)? How do I include the relations exactly? I have been able to import Single Model Data into App Maker easily, but am unclear how to do import All Models and Relations (see linked image below).

Here's the App Maker Import Data dialog I'm referring to


Solution

  • Without digging into documentation and your data structure, I would suggest that your exported data format would be the same as your to import format should be. In other words you can:

    1. Populate your app with some records of each type with all possible relations
    2. Export your dummy data to spreadsheet to reverse engineer it
    3. Populate spreadsheet with your data in exactly the same format App Maker generated it on step 2.
    4. Import your data

    You can try to immediately import exported data just to proof the entire concept and save some of your time.

    Note

    You cannot do all this magic for Preview, you need to have 'real' Deployment(s)