Skip to main content

Multiple forms in one record


I have three forms to fill out with data, and they go in sequence.

Is there any way that the answers from all three forms go into one entry.

Right now, each form creates a new record.

6 replies

Rupert_Hoffsch1
Forum|alt.badge.img+19

Hi Lev, no that’s not possible at the moment. Every form submit creates a new record. What’s the use case?


  • Author
  • New Participant
  • 2 replies
  • May 27, 2022
Rupert_Hoffsch1 wrote:

Hi Lev, no that’s not possible at the moment. Every form submit creates a new record. What’s the use case?


I am doing research in psychology and I need to present the form step by step for better perception.


Rupert_Hoffsch1
Forum|alt.badge.img+19
Lev_Korotich wrote:

I am doing research in psychology and I need to present the form step by step for better perception.


Would conditional fields maybe help? In the form builder, you can select if a field should only show up if certain conditions are met:

Otherwise it might make sense to use a more sophisticated form tool (Typeform, Jotform, …) and send that data into Airtable.


ScottWorld
Forum|alt.badge.img+33
  • Brainy
  • 8806 replies
  • May 27, 2022

@Lev_Korotich There are a few different ways of doing this in Airtable. Probably the easiest way is to ask for a unique identifier on each form (such as an email address) that you could match up using automations after submission. The easiest way to do this would be to keep all of your form submissions in one table, and link them to the person’s email address in another table. But you can certainly merge everything into one unified record too… that would be a more complex automation setup.


Forum|alt.badge.img+3
  • New Participant
  • 4 replies
  • June 4, 2023
ScottWorld wrote:

@Lev_Korotich There are a few different ways of doing this in Airtable. Probably the easiest way is to ask for a unique identifier on each form (such as an email address) that you could match up using automations after submission. The easiest way to do this would be to keep all of your form submissions in one table, and link them to the person’s email address in another table. But you can certainly merge everything into one unified record too… that would be a more complex automation setup.


I know this is an old thread, but I'm curious if you would be able to provide step by step instructions on how to do this. I think this would be the exact solution I need. I have potential clients complete an initial intake form and then complete a more in-depth form later in the process. I'd like to be able to have both forms link to the client. 


Forum|alt.badge.img
  • New Participant
  • 1 reply
  • November 21, 2023

For posterity, here is an example solution of what @ScottWorld suggests, using the "Edit code" text entry window in the "Run a script" automation step. The unique identifier is the email address, and there are two fields, called 'Submission1' and 'Submission2' to be taken from the second form to the first one.

// Set up data let table = base.getTable("MyTable"); let formUniqueIdentifierField = 'Email'; let formDataField1 = 'Submission1'; let formDataField2 = 'Submission2'; // Get records and fields let query = await table.selectRecordsAsync({fields: [ formUniqueIdentifierField, formDataField1, formDataField2 ]}); // Define dictionary to see if a unique identifier has already been seen var entryDict = {}; // Define array to hold all records to be deleted var toDelete = []; // Iterate over records let records = query.records; for (let record of records) { // Record unique identifier as a string var currentKey = record.getCellValueAsString(formUniqueIdentifierField); // If the unique identifier has already been seen, get the data of the second record if (currentKey in entryNameDict) { var currentChoice1 = record.getCellValue(formDataField1); var currentChoice2 = record.getCellValue(formDataField2); // Update the first record with this data await table.updateRecordAsync(entryNameDict[currentKey], { [formDataField1]: currentChoice1, [formDataField2]: currentChoice2, }); // Mark second record for deletion toDelete.push(record.id) // If unique identifier has not been seen, add the record id to dictionary } else { entryDict[record.getCellValueAsString(formUniqueIdentifierField)] = record.id; } } // Delete unnecessary records (careful, irreversible) for (let record_id of toDelete) { await table.deleteRecordAsync(record_id); }

 More fields can be added. Since deletion is irreversible, another option is to instead change some other field of the unnecessary records and delete them manually later.


Reply