cancel
Showing results for 
Search instead for 
Did you mean: 

Snaplogic iterate over array

arunsadhasivam
New Contributor

Hi ,

i have json like
payload{
input:[
{url: "test.com’,}
{url: "test.com’,},
{url: "test.com’,}
]
}

i need to iterate over payload.input[0].url ,payload.input[1].url and send url to restPOST api.
can you please suggest anyoption to get individual url by iterate the url list

5 REPLIES 5

arunsadhasivam
New Contributor

can you help me to understand rest post. can i send collections of url to rest post.
please kindly send me any sample input message which can be accepted by REST POST snap.
{
“payload” : {
“input” : [
{
“url” : “https://test.com/v1/leads/144307/merge.json?access_token=[TOKEN]&leadId=144436
},
{
“url” : “https://test.com/v1/leads/144307/merge.json?access_token=[TOKEN]&leadId=144436
},
{
“url” : “https://test.com/v1/leads/144307/merge.json?access_token=[TOKEN]&leadId=144436
},
]
}
},

Also let me know whether payload like below accepted or only it should be wrapped inside
document like above.
payload{
[‘test.com’,
test2.com’,
test3.com
]
}