Best answer

How do you split multiple values received by a webhook into individual values?

  • 18 February 2021
  • 2 replies
  • 1634 views

Userlevel 1

Sorry for the vague title, but I couldn’t really figure out how to word my question.

I’m not sure where to really take this Zap I’m trying to build, or if what I’m wanting to do is even possible. I will try to explain the best I can what I’m currently working on.

I make a Custom Webhook Request to a Rest API to retrieve ID values. This I have down and Zapier gives me the data as I would expect like so:

 

You can see that I have 3 returned objects (more not shown), but what I’m specifically needing is the “id” values for each object which Zapier does give me, but as a comma separated list.

 

My issue comes into play when I need to run another Webhook call after this to basically use each ID separately to delete the objects attached to these ID, but I’m not finding a way to make Zapier do this.

This is an example of how my webhook code would look using just a single ID at a time:

{
"id": "123",
"method": "deleteFields",
"params": {
"objects":[
{
"id":"3785354243"
}
]
}
}

While this works to delete a single object attached to this single ID, I need a way to take all of the IDs my first webhook found and then systematically run the above webhook, changing the ID after every run.

I tried mapping it like so without success:

{
"id": "123",
"method": "deleteFields",
"params": {
"objects":[
{
"id":"{{113777415__result__field[]id}}"
}
]
}
}

 

But obviously this Zap doesn’t know I’m wanting to run the webhook for each comma separated value.

Am I going about this the wrong way? Should I be sending these IDs as rows to a spreadsheet and then pump them back into my delete webhook call? Is this just not going to be possible?

I apologize if this is above what would normally be asked here, but really trying to figure this out on my own has not been going well so far and any help or advice would be greatly appreciated!

icon

Best answer by carter.reynolds 18 February 2021, 01:52

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

2 replies

Userlevel 7
Badge +14

Hi @carter.reynolds 

Check out the Looping app: https://zapier.com/apps/looping/integrations

Userlevel 1

Hi @carter.reynolds 

Check out the Looping app: https://zapier.com/apps/looping/integrations

Thank you! I had dug into the Looping function, but it wasn’t helping the issue of getting the webhook to run for each ID variable I was receiving.

 

I actually just happened to stumble across this, however:

 

Implemented this code by zapier step and so far it seems to work as expected.. can’t believe it was that simple!