Skip to content

Adding or Updating or Deleting an Airtable Column or Airtable Table

julianrkung edited this page May 4, 2021 · 1 revision

This page will guide an Admin on the procedure to add a new column, updating an existing column type, or adding an Airtable table to the main Airtable base and have it be usable in the app for development. These steps should be done in quick succession if possible to minimize the discrepancy between the code's Airtable schema and the Airtable UI's Airtable schema. If you are not technical, you will want a developer on hand to help you update the code's Airtable schema. This guide assumes you already know how to make your intended change via the Airtable UI

NOTE: Users using the app may run into technical difficulties refreshing their data while you're completing this workflow. Please try to do this workflow when minimal users are using the app or during off hours. It would also be wise to announce this maintenance change in advance so that users are aware that technical difficulties may occur during this time.

You only need to follow this guide if you perform one of the following:

  1. Add a new column to an Airtable table
  2. Add a new table to the Airtable base
  3. Updating a column by changing something within "Customize field type"
  4. Add lookup field
  5. Insert right/left
  6. Deleting an existing column / table

You do not need to follow this guide if you perform one of the following:

  1. Create an airtable form
  2. Sort using the Airtable UI (A->Z or Z->A)
  3. Adding a filter to the Airtable UI
  4. "Group by" this field

Adding / Updating / Deleting an Airtable Column / Table:

  1. Do your change in the Airtable UI (Adding / Updating / Deleting a column or table)
  2. The schemas for the backend and the frontend need to be regenerated so that they have the new changes in #1
    1. In the meepanyar-node repo, update the airtable schema by running npm run generate-schema

      1. Do not commit the newly generated airtable.js. Only commit the new schema.js and request.js files that are modified. This is because the airtable.js contains changes that permit certain requests in the app
      2. I recommend you locally run npm run start to make sure the service still runs properly.
    2. In the meepanyar repo, you need to update the airtable schema as well as apply the necessary schema patches.

      1. Run npm run generate-schema to get the most
      2. Run npm run apply-schema-patches. If a patch conflict occurs, see the "How to update Patches" section of the Airtable Schema Generator page.
    3. Make the necessary change to interface.ts (add/remove/update the field to the appropriate record, add a new, appropriately typed XRecord if a new table was created)

    4. Update any necessary EMPTY_X records (ie: EMPTY_CUSTOMER, EMPTY_INVENTORY_UPDATE, etc...) to include / exclude the updated field.

    5. I recommend you locally run npm run start in order to check any compile-time typescript errors that this might've introduced.

  3. Commit and push the meepanyar/ and meepanyar-node/ repos
  4. Redeploy the frontend and backend repositories so the Users can use the most updated version of the app.