When you're starting out in the editor, you're first going to add at least one table. However, as you're working with your data in the editor, you may realize you need to make changes to your spreadsheet. You may decide to add a column, remove a column, or rearrange columns. Then, you run into an error similar to the following in the emulator:
Unable to fetch app definition: Error: There is a mismatch in the number of columns between the spreadsheet for Class Descriptions and the table schema. The table has 5 columns but the schema has 4 columns. Please regenerate the table column structure.
For example, let's say this is your original spreadsheet; you have these three columns. Then, you decide to add another column in your spreadsheet and receive the error.
To resolve the error:
- Open the app in the editor.
- Go to Data > Columns.
- Expand the table you want to view or edit.
- Click Regenerate Structure.
- Save the app.
When you sync in the emulator, you'll now be able to see your additional column in whatever view(s) you have set up.
See also: Improve performance when you add, remove, or rearrange columns
Regenerate apps built from a Google Forms
If the app was built from a Google Form, the original form configuration will be stored in the response sheet in the form of notes attached to the header row. Regenerating will cause the columns to restore the settings contained within the notes, potentially overwriting changes you've made in the editor. To avoid this, remove the notes from the response sheet before regenerating. If you do accidentally regenerate with notes left in the sheet and lose your configuration, remember that you can restore an older version of the app using version history.
Modify the app without modifying the sheet
If you just want to hide or reorder some columns within the app, there are several ways to do so without modifying the underlying sheet.
- Slices allow you to filter out specific columns in any views based on the slice.
- Several view types allow you to control column order within the view settings.
- Individual columns can be hidden by using the Show? option.