cancel
Showing results for 
Search instead for 
Did you mean: 

Iterate JsonArray in parent to call child pipeline

vish_ch
New Contributor

Hello Community members,

I have a scenario to discuss, if you can provide your assistance

I am receiving JSOnArray in pipeline which I am then splitting using Json splitter and those individual documents I am passing to child pipeline.

In child pipeline, I am making HTTP call and getting Id in response.

So far so good but now I have a requirement to use Id from previous call in next HTTP call request.
How can I pass response payload in next child iteration?

Thanks.

3 REPLIES 3

koryknick
Employee
Employee

@vish_ch - I'm assuming that you are able to pull the response from your HTTP call to get an ID value that you want to use in the next HTTP call, and that the ID needs to be part of the URI - if that's the case, just enable the "expression" button of the URI property and build the URI using string concatenation.  Something like this:

koryknick_0-1718980310485.png

Hope this helps!

 

Hi @koryknick ,

Thanks for your reply.

The ID is part of POST body request.

Within parent pipeline, Json splitter is generating its multiple documents which are then passed to child pipeline via pipeline execute.
When next iteration happens and child pipeline is called, I am not able to retain the response from first iteration. how to solve that?

Thanks

endor_force
New Contributor III

You will have to map the content to send in the post using a mapper to the target format expected if it is JSON. 
Then you can set the HTTP Entity in the rest post snap to the path of the root of the content/structure you wish to send.

Based on your need and the requirements on the data you will post you can also play around with XML generator or JSON generator to build the target document using velocity templates, sometimes that could be an easier way (visually) if it is a more complex structure you need to map and post.

If you are still facing challenges please post some example on how the json is structured from the previous snap and how your POST request is expected to be sent and structured.