This action uploads the rows in a CSV file to the specified view. You can use Import to:

  • Add one or more new records to an AppSheet table.

  • Update one or more existing records in an AppSheet table.

  • Both add one or more new records to an AppSheet table and update one or more other existing records in an AppSheet table.

Invoking an "Import a CSV File for This View" Action

Once you have created an Import action as described in the sections below, you can invoke it as follows:

  1. Open the application in a desktop browser. Import only works when the app is running on a desktop browser, not when it is running on a iOS or Android device.

  2. Navigate to the table view having the Import action.

  3. Click the Import button. (If you do not see the Import button, you may need to edit the Import action and choose a different Prominence on the Appearance tab.)

  4. Use the File Open dialog which is displayed to select the CSV file you wish to import.

  5. An Import CSV Started dialog like the following will be displayed.

  6. When the Import finishes successfully, an Import CSV Finished dialog like the following will be displayed.

7. If an error occurs, an Import CSV Failed dialog like the following will be displayed. Refer to the Troubleshooting guidelines section below.

Choosing a CSV File Size

We impose a 4 minute time limit when importing a CSV file. We do this to ensure that all users get fair access to the system. Please keep this time limit in mind when creating your CSV file.

The following work all counts towards the time limit:

  1. The time to compute initial value expressions and virtual field app formulas.

  2. The time to check and update Change fields.

  3. The time to verify that each field contain a value of the appropriate type.

  4. The time to enforce Required, Required_If, and Valid_If conditions.

  5. The time to add or update the records to the table. This time depends, in part, on which provider the table uses. For SQL providers we batch read and write operations for efficiency.

  6. The time to re-read the added or updated records to obtain after images, if workflow rules are present.

  7. The time to process Workflow rules, if any.

As you can see, the time required to import a CSV file depends on a lot of factors and can be hard to predict. In general, the more rows and columns in the CSV file, the longer the import time. We suggest you start with a batch size of a few hundred to a few thousand records, and experiment to see how long CSV Import takes for your table. Then adjust your batch size to stay comfortably within the time limit.

Creating the "Import a CSV File for This View" Action

Do the following to create a "Import a CSV File for This View" action:

  1. In the Editor, go to the Behavior > Actions tab.

  2. Click New Action.

  3. Give the action a meaningful name by setting the Action name property.

  4. Use the For a record of this table dropdown to select the table in which the records should be added or updated.

  5. In the Do this dropdown select "App: import a CSV file for this view (not a row-level action)"

  6. Set the CSV file locale property as described in configure the CSV locale.

  7. Expand the Appearance tab.

  8. Give the Import button a meaningful name by setting the Display name property.

  9. Select an Action icon for the Import button. You can enter "import" in the search window and hit Enter to narrow down the list of icons. One of the icons showing an arrow going into a document is often a good choice.

  10. Select a Prominence to control how prominently the Import button is displayed.

  11. Click Save.

CSV File Format

Each row in the CSV file corresponds with a record to be added or updated in the table, except for the first row which must be a header row.

Each column in the CSV file corresponds with a field in the table. The header row contains the field names of the columns in the table. The column names in the CSV header row must exactly match the field names in the table including capitalization. The columns in the CSV file may occur in any order. They need not match the field order of the table.

It is not necessary to include a column in the CSV file for every field in the table. This is explained further below.

Adding Records

Each CSV Row value must normally include the key field value of the record being added. However, if the key field contains an "Initial value", you can omit the key field value because the system will initialize the key field to the "Initial value". For example, you should omit the key field value when the key field has an "Initial value" of UNIQUEID() or RandBetween().

If no CSV column is present for a field of the table, the table field's "Initial value" will be used to give the field a value.

When a Record is Added

  1. All fields are initialized to initial values and all app formulas are computed.

  2. The field values you specify in the CSV row are applied.

  3. App formulas are computed and change fields are updated.

  4. Required, Required_If, and Valid_If conditions are enforced.

  5. The record is added to the table.

  6. Workflow rules, if any, are invoked.

Updating Records

Each CSV row must specify the key value of a table record to be updated.

The CSV file should contain a column for every updatable field in the table except Virtual and Change columns. If you include a Virtual or Change column, the column value you specify will be ignored. If the CSV file omits an updatable column, the field's "Initial value" is used.

When a Record is Updated

  1. All fields are initialized to initial values and all app formulas are computed.

  2. The field values you specify in the CSV row are applied.

  3. App formulas are computed and change fields are updated.

  4. Required, Required_If, and Valid_If conditions are enforced.

  5. The record is updated in the table.

  6. Workflow rules, if any, are invoked.

CSV Row Data Values

Each column's values must be suitable for its column type.

The value for a Yes/No column can be specified in several equivalent ways.
All of the following values are equivalent ways of specifying "True".
Field values within quotes are case insensitive. For example, "TRUE, "True", "true", "TruE" are equivalent.

"MyBool": true 
"MyBool": "True"
"MyBool": "true"
"MyBool": "T"
"MyBool": "t"
"MyBool": "Yes"
"MyBool": "yes"
"MyBool": "Y"
"MyBool": "y"


All of the following values are equivalent ways of specifying "False".
Field values within quotes are case insensitive. For example, "FALSE, "False", "false", "FalsE" are equivalent.

"MyBool": false 
"MyBool": "False"
"MyBool": "false"
"MyBool": "F"
"MyBool": "f"
"MyBool": "No"
"MyBool": "no"
"MyBool": "N"
"MyBool": "n"


Troubleshooting

If CSV import fails see Troubleshooting CSV Import.

Did this answer your question?