How to save results from iterator to Airtable and Make.com

Hello, I have a scenario where I receive results from 7 different prompts obtained from ChatGPT. I want to update an Airtable record for each prompt.

For example, the iterator bundle position 1 corresponds to prompt 1. I need to save the results of prompt 1 from ChatGPT to the “Prompt 1 Response” field in Airtable. This process should be repeated for all prompts. With 7 prompt results, each result should be updated in Airtable accordingly, with the first value being the result for prompt 1, and so on. I’ve attached pictures of my scenario for reference.


Then you will need an array aggregator before you can map all the bundles from multiple operations in the same Airtable operation.

Aggregators

Every result (item/record) from iterator module will output a bundle. This can result in multiple bundles, which then trigger multiple operations in future modules (one operation per bundle). To “combine” multiple bundles into a single variable, you’ll need to use an aggregator of some sort.

Aggregators are modules that accumulate multiple bundles into one single bundle. An example of a commonly-used aggregator module is the Array aggregator module.

Hope this helps! Let me know if there are any further questions or issues.

@samliew

@samliew Thanks for you answer, can you please provide any demo/example Scenario. I have used array aggregator but it does not save the results.

@samliew If I use an array aggregator, it combines all the text into a single array. How can I separate each text and update the corresponding Airtable column?

For example, with the iterator labeled “Prompt 1,” it includes the text from “Prompt 1” from airtable and the results from ChatGPT in the “Prompt 1 Response” field in Airtable. I need to repeat this process for all prompts, ensuring that each prompt’s results are correctly placed in its respective column.

To map values from an array, you have to use the map-get combo.

map selects the property of the collections in the array.

get selects the item in the array based on the index.

This is covered in the Make Academy. Please take some time to go through the tutorials, otherwise you’ll be asking basic questions like these and wasting time (not that I mind).

Here are some useful links and guides you can use to learn more on how to use the Make platform, apps, and app modules. I found these useful when I was learning Make, and hope they might benefit you too —

Getting Started

Help Centre Basics

Articles & Videos

Hope this helps! Let me know if there are any further questions or issues.

@samliew

@samliew Yeah i know its basic question, but i am stuck in this problem from past week.
I will request you please if you can give scenario example. I will be very thankfull to you.

Module Export

You can copy and paste this module export into your scenario. This will paste example scenario modules.

  1. Copy the JSON code below by clicking the copy button when you mouseover the top-right of the code block

  2. Enter your scenario editor. Press ESC to close any dialogs. Press CTRLV (paste keyboard shortcut for Windows) to paste directly in the canvas.

  3. Click on each imported module and save it for validation. You may be prompted to remap some variables and connections.

Click to Expand Module Export Code

JSON - Copy and Paste this directly in the scenario editor

{
    "subflows": [
        {
            "flow": [
                {
                    "id": 260,
                    "module": "json:ParseJSON",
                    "version": 1,
                    "parameters": {
                        "type": ""
                    },
                    "mapper": {
                        "json": "{ \"array\": [\n  {\n    \"result\": \"abc123\"\n  },\n  {\n    \"result\": \"def456\"\n  },\n  {\n    \"result\": \"ghi789\"\n  }\n]}"
                    },
                    "metadata": {
                        "designer": {
                            "x": 3590,
                            "y": -694,
                            "name": "Generate sample array of collections"
                        },
                        "parameters": [
                            {
                                "name": "type",
                                "type": "udt",
                                "label": "Data structure"
                            }
                        ]
                    }
                },
                {
                    "id": 261,
                    "module": "builtin:BasicFeeder",
                    "version": 1,
                    "parameters": {},
                    "mapper": {
                        "array": "{{260.array}}"
                    },
                    "metadata": {
                        "designer": {
                            "x": 3831,
                            "y": -695
                        }
                    }
                },
                {
                    "id": 262,
                    "module": "builtin:BasicAggregator",
                    "version": 1,
                    "parameters": {
                        "feeder": 261
                    },
                    "mapper": {
                        "result": "{{261.result}}"
                    },
                    "metadata": {
                        "designer": {
                            "x": 4076,
                            "y": -695
                        }
                    }
                },
                {
                    "id": 263,
                    "module": "util:SetVariables",
                    "version": 1,
                    "parameters": {},
                    "mapper": {
                        "variables": [
                            {
                                "name": "Field 1",
                                "value": "{{262.array[1].result}}"
                            },
                            {
                                "name": "Field 2",
                                "value": "{{262.array[2].result}}"
                            },
                            {
                                "name": "Field 3",
                                "value": "{{262.array[3].result}}"
                            }
                        ],
                        "scope": "roundtrip"
                    },
                    "metadata": {
                        "designer": {
                            "x": 4319,
                            "y": -698,
                            "name": "Set 3 Fields"
                        }
                    }
                }
            ]
        }
    ],
    "metadata": {
        "version": 1
    }
}

Hope this helps! Let me know if there are any further questions or issues.

@samliew

1 Like

@samliew Thanks for the response. I have one question.

Which module should I use in my scenario instead of the Parse JSON module? I have the Iterator and ChatGPT modules included in the scenario, as shown in the attached picture.
Should i used only the Array aggreator after ChatGPT module?