How to Convert Airtable Records to Variables

Hi Make community. I have a question about how I can convert records from Airtable into variables. I created a simple scenario that iterates through records in Airtable and then creates variables based on the iteration. In the output of Set Variable, I see 3 correct operations (I have 3 records in Airtable) but I see only one variable in the further part of the scenario. When I use Get Multiple Variables, the effect is the same. What am I doing wrong?


It’s just an example of one of the variables from the list, on the output of the text parser you’ll probably get all three bundles. But I think you don’t need to use variables to move bundles to text parser, you can just paste there value from the iterator.

1 Like

Thanks for the response Mariana. Unfortunately, in the further part of the scenario, only the first variable is visible. The text parser was in the previous image only for the purpose of presenting the problem. Ultimately, I want to use these variables to create prompts for GPT from prompt fragments that are stored in Airtable records. Ultimately, I would like to have all the prompts under variables to manage prompts more easily (more readable).

Have you already tried to run with the last module and watch the output? Doesn’t the Chatgpt module send three bundles with answers in the output?

1 Like

The Airtable module you have is searching the database and returning 3 output bundles (basically 3 search results). Because of that any subsequent module is executed 3 times. So your iterator is running 3 operations (see the 3 bubble on the upper right corner of the iterator?). It runs all subsequent modules after the iterator 3 times in sequence). The set variable module is run 3 times as well and you are seeing the output from the first sequence of runs most likely. In each sequence the set variable is setting the variable each time it runs an operation.

So then the openAI module is also run 3 times once for each operation.

If you want to instead combine all 3 search results into 1 bundle with an array containing the components of the 3 airtable results, put an array aggregator right after your airtable module, aggregate the elements you wish to work with into an array and then access the elements of the array using a map() function inside your set variables. You won’t need the iterator anymore.

3 Likes

Thanks, Alex. I found another way to solve the problem, but I believe your solution works as well. I will check it out. Greetings.

2 Likes