<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Iterate over nested REST API Queries in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Iterate-over-nested-REST-API-Queries/m-p/2243926#M30255</link>
    <description>I have a system that I am trying to interact with that provides a set of nested entities through JSON. I have my top level REST queries working correctly (tREST component, feeding into a tExtractJSONFields - the fields are showing up correctly.) 
&lt;BR /&gt;For the next part of my process, I need to extract a single field from the tExtractJSONFields result, and send that query back to my parent system (
&lt;A href="https://api.system.com/getSubEntities?id=JSONID" target="_blank" rel="nofollow noopener noreferrer"&gt;https://api.system.com/getSubEntities?id=JSONID&lt;/A&gt;), so that I can iterate over those results. This process should continue down until I no longer receive sub entities. What is the best way to feed that result back into a REST query and iterate down? 
&lt;BR /&gt;Thank you!</description>
    <pubDate>Fri, 13 Dec 2013 20:19:48 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-12-13T20:19:48Z</dc:date>
    <item>
      <title>Iterate over nested REST API Queries</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Iterate-over-nested-REST-API-Queries/m-p/2243926#M30255</link>
      <description>I have a system that I am trying to interact with that provides a set of nested entities through JSON. I have my top level REST queries working correctly (tREST component, feeding into a tExtractJSONFields - the fields are showing up correctly.) 
&lt;BR /&gt;For the next part of my process, I need to extract a single field from the tExtractJSONFields result, and send that query back to my parent system (
&lt;A href="https://api.system.com/getSubEntities?id=JSONID" target="_blank" rel="nofollow noopener noreferrer"&gt;https://api.system.com/getSubEntities?id=JSONID&lt;/A&gt;), so that I can iterate over those results. This process should continue down until I no longer receive sub entities. What is the best way to feed that result back into a REST query and iterate down? 
&lt;BR /&gt;Thank you!</description>
      <pubDate>Fri, 13 Dec 2013 20:19:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Iterate-over-nested-REST-API-Queries/m-p/2243926#M30255</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-12-13T20:19:48Z</dc:date>
    </item>
    <item>
      <title>Re: Iterate over nested REST API Queries</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Iterate-over-nested-REST-API-Queries/m-p/2243927#M30256</link>
      <description>Hi
&lt;BR /&gt;Use a tLoop to make a loop exectuion for the processing until it return no sub-entities, the job design looks like:
&lt;BR /&gt;tLoop--iterate--tRest--main--tExtractJSONFields--main--tJavaRow
&lt;BR /&gt;Define a context variable, boolean type, let's call it condition and set its default value as true, and another context variable, name it as url and set a default value for it.
&lt;BR /&gt;on tLoop, set the Condition field as: context.condition
&lt;BR /&gt;on tRest, set the URL field as: context.url
&lt;BR /&gt;on tJavaRow:
&lt;BR /&gt;change the url based on the return field, for example:
&lt;BR /&gt;context.url="https://api.system.com/getSubEntities?id="+input_row.fieldName
&lt;BR /&gt;check the return field and determine to stop the loop or not, for example:
&lt;BR /&gt;if(input_row.fieldName==null){ //or other condition according to your real case.
&lt;BR /&gt;context.condition=false;
&lt;BR /&gt;}else{
&lt;BR /&gt;context.condition=true;
&lt;BR /&gt;}
&lt;BR /&gt;Shong</description>
      <pubDate>Sat, 14 Dec 2013 05:52:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Iterate-over-nested-REST-API-Queries/m-p/2243927#M30256</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-12-14T05:52:00Z</dc:date>
    </item>
  </channel>
</rss>

