<?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 Re: JSON Array with Web Service TRestClient in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/JSON-Array-with-Web-Service-TRestClient/m-p/2249762#M148757</link>
    <description>&lt;P&gt;Hi @Francis Noyeau​&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your JSON has two loops defined by its arrays: the root level array and the "rapprochements" array.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But the tExtractJSONFields component allows only one loop at the "&lt;I&gt;Requéte de boucle JSONPath&lt;/I&gt;".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, there are some approaches you can try and see what fits best for you:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A) Set the Loop Jsonpath query to iterate over the root array using the &lt;B&gt;"$"&lt;/B&gt; operator (that is the root object/element of a JSON). And then, in the Mapping Json query, you could use expressions like:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;"id"&lt;/LI&gt;&lt;LI&gt;"rapprochements[*].propositionId"&lt;/LI&gt;&lt;LI&gt;"rapprochements[*].demande.id"&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;One downside of this approach is that the component will not loop over the "rapprochements" element. Instead, it will output its subelements as an array.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;B) Set the Loop Jsonpath query to iterate over the "rapprochements" array using the expression &lt;B&gt;"$..rapprochements[*]". &lt;/B&gt;And then, in the Mapping Json query, you could use expressions like:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;".propositionId"&lt;/LI&gt;&lt;LI&gt;".demande.id"&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;But notice that using this loop level, you wouldn't be able to reach the "id" on the parent level because the jsonpath doesn't have a parent operator (&lt;A href="https://goessner.net/articles/JsonPath/index.html" alt="https://goessner.net/articles/JsonPath/index.html" target="_blank"&gt;reference&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;C) Change the "Read by" option on tExtractJSONField to use Xpath expressions and set the loop  xpath query to &lt;B&gt;"/rapprochements"&lt;/B&gt;. And then, in the Mapping Xpath query, you could use expressions like:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;"../id"&lt;/LI&gt;&lt;LI&gt;"./propositionId"&lt;/LI&gt;&lt;LI&gt;"./demande/id"&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Notice that this approach use the same loop level as the previous, but it allows you to reach the elements at parent level using the &lt;B&gt;".."&lt;/B&gt; expression.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;D) Finally, since you're using tRESTClient to get this JSON, you could use tXMLMap instead of tExtractJSONFields because tRESTClient automatically converts JSON responses to a DOM Document and looping over multiple levels using tXMLMap is far easier, in my opinion.&lt;/P&gt;</description>
    <pubDate>Sat, 08 Jul 2023 23:35:01 GMT</pubDate>
    <dc:creator>anselmopeixoto</dc:creator>
    <dc:date>2023-07-08T23:35:01Z</dc:date>
    <item>
      <title>JSON Array with Web Service TRestClient</title>
      <link>https://community.qlik.com/t5/Talend-Studio/JSON-Array-with-Web-Service-TRestClient/m-p/2249761#M148756</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a JSON file that looks like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000kWuKFAA0.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/132900i0EF50B4B5213E39F/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000kWuKFAA0.png" alt="0695b00000kWuKFAA0.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I get JSON data from the web service using a TRESTClient component and I extract data with a tExtractJSONFields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BUT I can't extract data from the "rapprochements" array.&lt;/P&gt;&lt;P&gt;I tried several JSON query unsuccesfully.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000kWuLIAA0.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/135702iCFAF010B74352517/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000kWuLIAA0.png" alt="0695b00000kWuLIAA0.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000kWuLNAA0.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/131145iC104B81248431AEB/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000kWuLNAA0.png" alt="0695b00000kWuLNAA0.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea or suggestion ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for your help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jan 2026 14:45:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/JSON-Array-with-Web-Service-TRestClient/m-p/2249761#M148756</guid>
      <dc:creator>Francis28</dc:creator>
      <dc:date>2026-01-02T14:45:42Z</dc:date>
    </item>
    <item>
      <title>Re: JSON Array with Web Service TRestClient</title>
      <link>https://community.qlik.com/t5/Talend-Studio/JSON-Array-with-Web-Service-TRestClient/m-p/2249762#M148757</link>
      <description>&lt;P&gt;Hi @Francis Noyeau​&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your JSON has two loops defined by its arrays: the root level array and the "rapprochements" array.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But the tExtractJSONFields component allows only one loop at the "&lt;I&gt;Requéte de boucle JSONPath&lt;/I&gt;".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, there are some approaches you can try and see what fits best for you:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A) Set the Loop Jsonpath query to iterate over the root array using the &lt;B&gt;"$"&lt;/B&gt; operator (that is the root object/element of a JSON). And then, in the Mapping Json query, you could use expressions like:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;"id"&lt;/LI&gt;&lt;LI&gt;"rapprochements[*].propositionId"&lt;/LI&gt;&lt;LI&gt;"rapprochements[*].demande.id"&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;One downside of this approach is that the component will not loop over the "rapprochements" element. Instead, it will output its subelements as an array.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;B) Set the Loop Jsonpath query to iterate over the "rapprochements" array using the expression &lt;B&gt;"$..rapprochements[*]". &lt;/B&gt;And then, in the Mapping Json query, you could use expressions like:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;".propositionId"&lt;/LI&gt;&lt;LI&gt;".demande.id"&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;But notice that using this loop level, you wouldn't be able to reach the "id" on the parent level because the jsonpath doesn't have a parent operator (&lt;A href="https://goessner.net/articles/JsonPath/index.html" alt="https://goessner.net/articles/JsonPath/index.html" target="_blank"&gt;reference&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;C) Change the "Read by" option on tExtractJSONField to use Xpath expressions and set the loop  xpath query to &lt;B&gt;"/rapprochements"&lt;/B&gt;. And then, in the Mapping Xpath query, you could use expressions like:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;"../id"&lt;/LI&gt;&lt;LI&gt;"./propositionId"&lt;/LI&gt;&lt;LI&gt;"./demande/id"&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Notice that this approach use the same loop level as the previous, but it allows you to reach the elements at parent level using the &lt;B&gt;".."&lt;/B&gt; expression.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;D) Finally, since you're using tRESTClient to get this JSON, you could use tXMLMap instead of tExtractJSONFields because tRESTClient automatically converts JSON responses to a DOM Document and looping over multiple levels using tXMLMap is far easier, in my opinion.&lt;/P&gt;</description>
      <pubDate>Sat, 08 Jul 2023 23:35:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/JSON-Array-with-Web-Service-TRestClient/m-p/2249762#M148757</guid>
      <dc:creator>anselmopeixoto</dc:creator>
      <dc:date>2023-07-08T23:35:01Z</dc:date>
    </item>
    <item>
      <title>Re: JSON Array with Web Service TRestClient</title>
      <link>https://community.qlik.com/t5/Talend-Studio/JSON-Array-with-Web-Service-TRestClient/m-p/2249763#M148758</link>
      <description>&lt;P&gt;Hi @Anselmo Peixoto​&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for your reply.&lt;/P&gt;&lt;P&gt;It helps me to solve my problem and to learn more about Jsonpath query&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2023 10:26:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/JSON-Array-with-Web-Service-TRestClient/m-p/2249763#M148758</guid>
      <dc:creator>Francis28</dc:creator>
      <dc:date>2023-07-11T10:26:06Z</dc:date>
    </item>
  </channel>
</rss>

