File Management

Airtable Import to Xano with Data Transformation

Summary

Xano's Airtable import feature allows you to seamlessly migrate your data from Airtable to the Xano platform. This guide will walk you through the import process and demonstrate how to transform and manipulate your data after the import is complete.

Importing Data from Airtable

  1. Get Your Airtable API Key
  • Click on the account icon in the top-right corner of your Airtable base
  • Select "Account" from the dropdown menu
  • Click "Generate API key"
  • Copy the generated API key
  1. Start the Import Process
  • If you're new to Xano, you'll be prompted to import data during the onboarding "Jumpstart Wizard"
  • Select "Import data from Airtable" and click "Get Started"
  • Name your Xano workspace and click the "Import from Airtable" button
  • Paste your Airtable API key and click "Continue"
  1. Select Your Airtable Base and Tables
  • Choose the Airtable base you want to import
  • Select the specific tables and views you want to import
  • Check the "Download and import attachments" box if your Airtable base contains attachments
  • Click "Continue" and then "Finish"
  1. Monitor the Import Process
  • Xano will start processing and fetching your tables
  • Once the import is complete, you'll see a banner prompting you to "Update Xano to see the new data"
  • Click "Update Xano" to view your imported data in the Xano database

Transforming Imported Data

After importing your data from Airtable, you may want to transform or manipulate it to suit your needs. Here's an example of how to create a new field that combines the first and last name fields into a single "Full Name" field.

  1. Add a New Field
  • In your Xano database, navigate to the table you want to modify (e.g., "Customers")
  • Click the "+" icon to add a new column
  • Create a new text field called "Full Name" and save it
  1. Create an API Endpoint
  • Click the "Create API" button and select "Start from scratch"
  • Name your API endpoint (e.g., "Create Full Names") and click "Save"
  1. Query the Data
  • In the function stack, add a "Database Request" step to query all records from your table
  • Rename the variable storing the queried data to something descriptive (e.g., "customerData")
  1. Update the Response
  • Set the response to `customerData` to view the queried data after running and debugging
  1. Loop Through Records
  • Add a "For Each" loop to iterate through each record in `customerData`
  • Inside the loop, add a "Stop and Debug" step to inspect the structure of the current record (`item`)
  • Copy the result from the "Stop and Debug" step for later use
  1. Edit Records
  • Add an "Edit Record" step inside the loop
  • Set the record ID using the `item` variable and the copied result from the previous step
  • Enable the "Full Name" field for editing
  • Use the `sprintf` filter to combine the first and last name fields into the "Full Name" field
  • Add another "Stop and Debug" step to verify the edited record
  1. Update the Response
  • Remove the "Stop and Debug" steps
  • Run and debug the loop to update all records with the combined "Full Name" field
  1. Update the Response
  • Change the response to return the updated data from the database table

Maintaining Calculated Fields

If you have calculated fields or formulas in your Airtable base that need to be maintained in Xano, you can utilize background tasks to keep the data up-to-date.

  1. Create a Background Task
  • Navigate to the "Tasks" section in Xano
  • Add a new task and give it a descriptive name (e.g., "Calculate Time")
  1. Query the Data
  • In the task's function stack, add a "Database Request" step to query all records from the relevant table
  1. Loop Through Records
  • Add a "For Each" loop to iterate through the queried records
  • Inside the loop, add a "Stop and Debug" step to inspect the structure of the current record (`item`)
  1. Retrieve Related Data
  • Add a "Get Record" step to fetch the related record (e.g., the user record) based on the ID from the `item` variable
  • Use another "Stop and Debug" step to verify the retrieved record
  1. Calculate the Value
  • Create a new variable to store the calculation result
  • Use the `now` variable and the `subtract` filter to calculate the difference between the current time and the related record's timestamp (e.g., user's start date)
  • Convert the result from milliseconds to seconds if needed
  • Verify the calculation using a "Stop and Debug" step
  1. Update the Record
  • Add an "Edit Record" step to update the calculated field in the original record
  • Use the `item` variable to specify the record ID
  • Set the calculated field value to the result of the calculation
  1. Enable the Task
  • Remove the "Stop and Debug" steps
  • Run the task once to update the data initially
  • Click the "Enable Task" button and set the desired frequency for the task to repeat (e.g., every hour, day, etc.)

By following these steps, you can seamlessly import your data from Airtable to Xano and transform or maintain calculated fields as needed. Remember, Xano's visual interface and no-code approach make it easy to manipulate your data without writing code.

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