Returning data from an array and split then use each value to append a url request

Hi all I am calling an api to return data using http request , I have the data back fine and have used the split sequence to return the values I want from the Array that was generated.

Data comes back as this in the debug window.

11/18/2020, 6:15:01 PMnode: SITE LISTmsg.payload : string[4]

"DCF1"

11/18/2020, 6:15:01 PMnode: SITE LISTmsg.payload : string[4]

"DMA2"

11/18/2020, 6:15:01 PMnode: SITE LISTmsg.payload : string[4]

"DZL4"

11/18/2020, 6:15:01 PMnode: SITE LISTmsg.payload : string[4]

"DCR3"

11/18/2020, 6:15:01 PMnode: SITE LISTmsg.payload : string[4]

"DHH1"

11/18/2020, 6:15:01 PMnode: SITE LISTmsg.payload : string[4]

"DBB1"

I would like to then do another http request but add my returned value to the url I want to interrogate e.g. http://mysite/"MY STRING"/blahblahblah and run the http request for each value I put into it. but am not sure how to proceed.

Firstly the string being returned is in double quotes" " that I would like to remove but I cant seem to get rid of them using the change node, Im assuming when that is done I set my string as a variable and then inject it into the http request. but am unsure how to do so and how to use each value to trigger a new http request.

I know its pretty simple stuff but I am very new to this and have had a google but cant seem to find what I am looking for.

Can anyone give me some pointers please so I can get this going ( I woud rather not have the full answer just the steps I should follow please so I can try to work the rest out myself.

Thankyou for your time.

The quotes are only there in the sidebar to help show you it is a string. They are probably not there for real. If you send the debug also to the console you’ll be able to check.

You are correct I copied a value and the quotes are not there, thankyou. I didn't think to check, something new learned. do you have any advice on the rest ?

Then maybe a template node to form up the url as you need to request then an http request node to do the requests etc

thanks ill have a google.

It would be quicker to just try it

I did, thankyou it worked perfectly.

inject > http request (to get array of values) > Split >Template (to get{{payload}}) then > Url request with the {{payload}} in the correct place > Debug

all data comes back just how I wanted it.

Thankyou for your time, much appreciated.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.