Help

Re: How can I send multiple records to Integromat webhook?

6399 6
cancel
Showing results for 
Search instead for 
Did you mean: 
Claire_Conza
6 - Interface Innovator
6 - Interface Innovator

Hi all

I need to send a json payload to an integromat webhook using an automation triggered by a view but I can’t figure out how to prepare the structure of the array it needs.

I want to loop through a table and then pass these records (containing one field) to integromnat.

I can do it with a single value like this when I map PID to a field

let data = input.config();

const returnPayload = await fetch(`https://hook.integromat.com/3gcj7g0zhntlwgkgm6crtdjo3i1jsvmu?PID=${data.pid}`);

var payloadResponse = await returnPayload.json()

console.log("done");

Has anybody done this before please?

This is what I think I need the array to look like but I still don’t know how to add it to the webhook url

[
    {
      "name" : "Peter",
      "ID" : 1
    },
    {
      "name" : "Mike",
      "ID" : 2
    }
]

In which case the output will be a series of bundles, each bundle containing one array’s item:

d1314fcdad49bb1462899a5452bb533bd8018e23.png

Thanks

Claire

12 Replies 12
M_k
11 - Venus
11 - Venus

Hi @Claire_Conza

Try using the HTTP and Webhook modules, using Airtable API for the view, you might need to use JSON parse. In the HTTP module you will include Authorization and Bearer key.

You are correct about the JSON structure (second option) which you will use in JSON Parse module and you might have to use the Iterator.

I found that the webhook might need to be used with the website blob JSON. You would use the http that the webhook generates in the URL window in blob JASON, to make the call. Then you would test the Airtable API in Postman.

Once you have everything set up then you would use the Data tag and place that in the JSON Parse, in the JSON string.

If you like I can take some screenshots of the scenario that I have, using the above modules. It is used for backing up Airtable records. It might give you an idea of how it works.

Mary Kay

Claire_Conza
6 - Interface Innovator
6 - Interface Innovator

Thanks so much Mary!

Any help including screen shots or example code would be super helpful, especially on the airtable side within the automation that sends the webhook.

It’s the syntax of the webhook URL I’m struggling with and making sure if creates the multiple bundles in integromat so I can the run my other modules.

Thanks again. Really hoping I can get this figured out.

Take care

Claire

Hi @Claire_Conza

Here are some screenshots of webhooks and HTTP modules. They are part of a three part scenario to backup Airtable records, which I had help with, since it’s an advanced scenario. Some of the settings you might not need, since they are the advanced settings. You basically need the URL, Method, Body type, Content type and check off parse response.

To test the webhook, try using the URL that was generated in the webhook, by using JSON blob, https://jsonblob.com and JSON formatter for the JSON structure https://www.freeformatter.com/json-formatter.html and Postman to just test Airtable API https://www.postman.com

Here are some documentation, from Integromat, about webhooks, Iterator and JSON. You can also check out Youtube videos, too. I am just providing all kinds of information here, you can glean out what you need. There is also the Integromat Facebook forum, they are a helpful bunch for both Integromat and Airtable enquires.

Here are the screenshots:

image image image image image image image image
image

Thanks Mary

Much appreciated. Can you share what your automation or scripting block code looks like please?

It’s the airtable side I’m struggling the the most. I’m essence, how to send an array of records to the webhook URL.

I was also hoping that there a way to send all records to the webhook and have them be received as seperate bundles.

Thanks

Claire

Hi @Claire_Conza

I actually used Airtable API to retrieve and create Airtable records. Once I tested the connection with Postman, I then selected the table of records that I wanted, I then copied and pasted the web address, associated with those records, together with the authorization and bear key, into the HTTP module and used the web address that gets generated in the Webhook module.

This is the Facebook tutorial that I watched, maybe it will help:

In terms of the array, I’m afraid that I am not quite sure how to do that, at this time. I am still learning.

I would suggest that you post your questions on the Integromat Facebook page. I am sure someone can help you.

Mary

Hi Claire

I found another video by an Integromat member, regarding Automation and Webhooks.

Thanks!

I found that yesterday and that definetly helped put me on the right track. The difficult / issue I’m having is to send an array of records to the integromat webhook not just a single record and I can’t for the life of me figure out how to send an array with multiple values.

My process is hopefully going to be:-

Loop through view and create an array like this…

[
    {
      "PID" : "abc12345"
    },
    {
      "PID" : "def6789"
    },
    {
      "PID" : "ghi10111213"
    },

]

and then…

1 Send this array to an integromat webhook
2. search for these PID in another table in another base (airtable)
3. Delete if found

Wish it wasn’t so hard :frowning:

Thank you so much for all your help so far though!

Thanks

Claire

@Claire_Conza

I here you! There certainly is a learning curve.

If I come up with any suggestions/info, I will let you know.

Come to think of it, I could post the last post you just sent me on the Integromat forum and see what response I get? If there is no sensitive information.

Also, if there is other pertinent information.

Let me know.

Mary

Thanks so much! My brother in law is posting furiously on there as he’s more technical than me but no joy so far :-(.

Thanks again for all your help Mary!

Take care

Claire