Retrieving form submission data in Airtable automation scripts

I’m new to Airtable and struggling with a form-related automation. Here’s what I’m trying to do:

  1. Users fill out a form
  2. On submit, I want to send the data to a remote database
  3. I’ve set up an automation to run after submission
  4. The remote DB creates a record and returns an ID
  5. I need to use this ID in my Airtable record

The problem is, I can’t figure out how to access the submitted form data in my automation script. I know how to work with tables and records:

const myTable = base.getTable('My Cool Table');
const record = await input.recordAsync('', myTable);

But I’m lost when it comes to forms. Is there a way to get the form data, like this?

const formInfo = base.getForm('Awesome Form');

Any help would be great. I’m totally stuck!

I’ve encountered a similar challenge with Airtable automations and form submissions. Here’s what worked for me:

When you set up the automation trigger for form submission, Airtable automatically provides the submitted data in the script context. You don’t need to fetch it separately.

In your automation script, you can access the form fields directly using:

let fieldValue = input.config().fieldName;

Replace ‘fieldName’ with the actual name of your form field.

For sending data to an external database, I’ve used the fetch() function within the script. Once you get the ID back, you can update your Airtable record using the built-in updateRecordAsync() function.

This approach has been reliable for me in handling form submissions and external integrations. Let me know if you need more specifics on implementation.

hey tom, i’ve been there! for form submissions, you wanna use the ‘When a form is submitted’ trigger. in the automation script, you can access submitted data with input.config(). like:

let formData = input.config();
let name = formData.name;
let email = formData.email;

hope this helps! lemme know if u need more info

I’ve worked with Airtable automations extensively, and accessing form data is indeed a bit tricky at first. The key is to understand that form submissions are treated as record creations in Airtable.

When you set up an automation triggered by a form submission, you’re essentially working with the newly created record. You can access this record and its fields using the input.config() method, as others have mentioned.

One thing to note: if you’re sending data to an external database, consider using Airtable’s built-in HTTP request action instead of writing custom fetch() calls in your script. It’s often more reliable and easier to maintain.

For updating the Airtable record with the external ID, you can use the updateRecordAsync() function within your script. Just make sure you’re targeting the correct table and record ID.

Remember to handle potential errors in your script, especially when dealing with external API calls. It’ll make debugging much easier down the line.