Integration

Migrating from Airtable to Xano

Summary

Welcome to our guide on importing data from Airtable to Xano and recreating formulas and rollups using Xano's powerful features. In this article, we'll walk you through the entire process, from generating personal access tokens to creating custom logic with function stacks and triggers.

Step 1: Generate a Personal Access Token in Airtable

To begin, you'll need to generate a personal access token in Airtable. Here's how:

  1. Navigate to the top right corner of your Airtable base and click on your icon.
  2. Select "Developer Hub" from the dropdown menu.
  3. Click "Create a Personal Access Token" and give it a name (e.g., "Xano Token").
  4. Add the following read scopes: `data.records:read`, `data.recordComments:read`, `data.viewComments:read`, and `data.metadata.bases:read`.
  5. Choose the appropriate access level for the token (current base, current workspace, or all workspaces).
  6. Click "Create Token" and copy the generated token securely.

Step 2: Store the Token in Xano

To import your Airtable data into Xano, you'll need to store the personal access token securely. Here's how:

  1. In Xano, navigate to Settings and click on "Environment Variables."
  2. Create a new environment variable (e.g., "Airtable Token") and paste the personal access token as the value.
  3. Optionally, create a new API group (e.g., "Airtable Import") to organize the CRUD endpoints that will be generated during the import process.

Step 3: Import Airtable Data into Xano

Now that you have your personal access token stored securely, you can import your Airtable data into Xano:

  1. In Xano, navigate to the Database section and click "Add Table" > "Import Data" > "Airtable."
  2. Paste your personal access token and select whether you want to remember it for future imports.
  3. Select the Airtable base you want to import data from.
  4. Choose the tables and attachments you want to import.
  5. Decide whether you want to create basic CRUD endpoints in Xano and select the API group you created earlier (if applicable).
  6. Click "Import" and wait for the process to complete.
  7. Once the import is finished, click "Update Xano" to see your imported data.

Step 4: Recreate Rollups with Function Stacks

Airtable's rollups and formulas are imported as text fields in Xano. To recreate their functionality, you'll need to use Xano's function stacks. Let's walk through an example:

  1. Locate the rollup field you want to recreate (e.g., "Employee Count" in the "Departments" table).
  2. Right-click on the field and change its type from text to integer.
  3. In Xano, navigate to the Library and create a new function (e.g., "Department Count").
  4. Add a "Query All Records" function to the function stack, selecting the "Departments" table.
  5. Customize the response to remove unnecessary fields and rename the output to "Departments."
  6. Add a "For Each Loop" function, iterating over the "Departments" list.
  7. Inside the loop, add another "Query All Records" function, this time selecting the "Employee Directory" table.
  8. Add a custom query to filter records where the "Department" column matches the current department's ID.
  9. Return the count of the filtered records and update the "Employee Count" field in the "Departments" table with this value.
  10. Run and debug the function stack to ensure it works as expected.
  11. Publish the function to make it available for use in your application.

Step 5: Recreate Formulas with Triggers

Airtable's formulas can be recreated in Xano using triggers. Here's an example of recreating a formula that calculates an employee's pay based on their hourly rate and hours worked:

  1. Locate the formula field you want to recreate (e.g., "Pay" in the "Pay" table).
  2. Right-click on the field and change its type from text to integer.
  3. In Xano, navigate to the Database section and create a new database trigger (e.g., "Pay Formula").
  4. Configure the trigger to run whenever a record is inserted or updated in the "Pay" table.
  5. In the trigger's function stack, add an "Edit Record" function, selecting the "Pay" table and the record's ID from the new record.
  6. Update the "Pay" field with a calculation based on the new record's "Hourly" and "Hours" fields (e.g., `new.hourly * new.hours`).
  7. Publish the trigger to make it active.

By following these steps, you can seamlessly migrate your Airtable data to Xano and recreate formulas and rollups using Xano's powerful no-code capabilities. Remember, Xano provides ultimate control and flexibility over your application's behavior, allowing you to create custom logic tailored to your specific needs.

If you have any questions or need further assistance, feel free to reach out to our support team through the in-app chat or the Xano community forums. Happy building!

This transcript was AI generated to allow users to quickly answer technical questions about Xano.

Was this helpful?

I found it helpful

I need more support
Sign up for XanoSign up for Xano

Build without limits on a secure, scalable backend.

Unblock your team’s progress and create a backend that will scale for free.

Start building for free