Upcoming database upgrades. Airtable functionality will be reduced for ~15 minutes at 06:00 UTC on Feb. 4 / 10:00 pm PT on Feb. 3. Learn more here

How to create multiple records from webhook

Topic Labels: Automations
301 8
Showing results for 
Search instead for 
Did you mean: 

Here’s how the data looks:

       "gatewayID":"956995" ,
       "gatewayName":"Ethernet Gateway 4 - 956995" ,
       "networkID":"66417" ,
       "messageType":"0" ,
       "batteryLevel": "101" ,
       "date": "2022-09-16 00:00:30",
       "signalStrength": "0",
       "pendingChange": "False" 

          "sensorID":"701519" ,
          "sensorName":"Cooler 1",
          "state": "16",
          "messageDate": "2022-09-16 00:00:03",
          "dataType": "TemperatureData",
          "dataValue": "7.9",
          "plotValues": "46.22",
          "plotLabels": "Fahrenheit",
          "batteryLevel": "13",
          "signalStrength": "76",
          "pendingChange": "True",
          "voltage": "2.24"

          "sensorID":"644289" ,
          "sensorName":"Wash Water Temp",
          "state": "0",
          "messageDate": "2022-09-16 00:00:04",
          "dataType": "TemperatureData",
          "dataValue": "23.7",
          "plotValues": "74.66",
          "plotLabels": "Fahrenheit",
          "batteryLevel": "100",
          "signalStrength": "93",
          "pendingChange": "True",
          "voltage": "3.33"

          "sensorID":"701520" ,
          "sensorName":"Cooler 2",
          "state": "16",
          "messageDate": "2022-09-16 00:00:04",
          "dataType": "TemperatureData",
          "dataValue": "22.8",
          "plotValues": "73.04",
          "plotLabels": "Fahrenheit",
          "batteryLevel": "100",
          "signalStrength": "77",
          "pendingChange": "True",
          "voltage": "2.68"




It shows up in airtable this way:
2022.09.15 - JM Screenshot - 000001@2x

For each of these sensors, I would like to create a new record with the name of the sensor and the temperature. Any help would be appreciated.

8 Replies 8

There are only 2 ways to loop through JSON data and create a new record in Airtable for each record in your JSON data:

  1. Write a custom JavaScript to process the data. I don’t know JavaScript, so somebody else would need to guide you there.

  2. Use an external automation tool that offers webhooks, like Send your data to a webhook there, and Make will automatically loop through all the JSON records on your behalf so you can create individual records in Airtable. (Make might also natively support whatever app is providing you with that JSON data.)

Can you proxy the JSON data through a different service to flatten the data? Otherwise you are going to have trouble with the Airtable receiving webhook accessing all of the body.

I don’t know JavaScript either. I did try make.con but it only works with the first record, it doesn’t keep going with the others. Perhaps there’s a setting in missing?

Make definitely works with all the records. You may need to use the Parse JSON tool or the Iterator tool to help you get all the records.

it’s a tricky task for first time, but last weeks I had todo a lot of table ‘rotations’, so it’s not so much code needed

put each value in separate variable, try to not add spaces and extra chars, because then array will be converted to string.
I did for 4 properties, for example, you may add all or choose any you want and even no need to change code.


You can use output variables to create records at next step. I mean, 3 next create record steps ))


const {id,}=input.config();
const msg={id,}
const keys=Object.keys(msg)

or, you can match variable names with field names, and if fields are simple text, substitute last line (sensors.foreach...) by write command, and put it to table:


await base.getTable('NAME').createRecordsAsync(>({fields:s})))


I was able to get it done with the parse json tool and the iterator.

Thank you for the help. I was able to get it done with make, but I’m going to try scripting as well since the native solution would be the most robust.

That’s great to hear! Make is the best! :grinning_face_with_big_eyes: