<?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: Help with converting JSON response to table in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Help-with-converting-JSON-response-to-table/m-p/2291761#M64914</link>
    <description>&lt;P&gt;@Steve Williams​&amp;nbsp;there are multiple array in the Json string, you can't extract all array values with one tExtractJsonField, I think you cache the string in memory and in use different tExtractJsonField components to extract each part in next subjobs, and append the each part to the same file, the job looks like:&lt;/P&gt;&lt;P&gt;tRestClient--main--tHashOutput1&lt;/P&gt;&lt;P&gt;|onsubjobok&lt;/P&gt;&lt;P&gt;tHashinput1--main-tExtractJason2--&amp;gt;-tJavaRow1&lt;/P&gt;&lt;P&gt;|onsubjobok&lt;/P&gt;&lt;P&gt;tHashInput2--main--tExtractJason2--&amp;gt;tMap1--&amp;gt;tFileOutputDelmited1&lt;/P&gt;&lt;P&gt;|onsubjobok&lt;/P&gt;&lt;P&gt;extract data from Services array and append data to the same file&lt;/P&gt;&lt;P&gt;|onsubjobok&lt;/P&gt;&lt;P&gt;extract data from Other array and append data to the same file&lt;/P&gt;&lt;P&gt;|onsubjobok&lt;/P&gt;&lt;P&gt;extract data from Training array and append data to the same file&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;tHashOutput: cache the json string in memory.&lt;/P&gt;&lt;P&gt;tHashInput1: read json string from memory, &lt;/P&gt;&lt;P&gt;tExtractJsonField1: extract choice_category value only&lt;/P&gt;&lt;P&gt;tJavaRow1: store choice_category value to global variable for used later, eg:&lt;/P&gt;&lt;P&gt;globalMap.put("key",input_row.choice_category)&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;tHashInput2: read json string from memory, &lt;/P&gt;&lt;P&gt;tExtractJsonField2: extract &lt;B&gt;choice_category_subtype &lt;/B&gt;value from Admin array.&lt;/P&gt;&lt;P&gt;tMap1: in the output table, add two new column, one is choice_category, set it's expression as:&lt;/P&gt;&lt;P&gt;(String)globalMap.get("key")&lt;/P&gt;&lt;P&gt;another column is choice_category_type, set it's expression as "Admin"&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;other arrays follows the same logic. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shong​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;</description>
    <pubDate>Wed, 16 Mar 2022 10:10:08 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-03-16T10:10:08Z</dc:date>
    <item>
      <title>Help with converting JSON response to table</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Help-with-converting-JSON-response-to-table/m-p/2291760#M64913</link>
      <description>&lt;P&gt;Hi. I'm not very knowledgeable on JSON, and am trying to interpret a JSON response from an API call and convert it into a table using Talend.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the tRESTClient response:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;B&gt;{&lt;/B&gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;B&gt;&amp;nbsp;&amp;nbsp;"choice_category": "type",&lt;/B&gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;B&gt;&amp;nbsp;&amp;nbsp;"choice_category_dependence": {&lt;/B&gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;B&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"Admin": [&lt;/B&gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;B&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"Email",&lt;/B&gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;B&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"Post",&lt;/B&gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;B&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"Filing"&lt;/B&gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;B&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;],&lt;/B&gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;B&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"Services": [&lt;/B&gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;B&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"Customer Call",&lt;/B&gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;B&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"Returns",&lt;/B&gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;B&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"Customer Email"&lt;/B&gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;B&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;],&lt;/B&gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;B&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"Other": [&lt;/B&gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;B&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;""&lt;/B&gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;B&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;],&lt;/B&gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;B&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"Training": [&lt;/B&gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;B&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"Online Course",&lt;/B&gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;B&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"Classroom Course"&lt;/B&gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;B&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;]&lt;/B&gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;B&gt;&amp;nbsp;&amp;nbsp;}&lt;/B&gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;B&gt;}&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to extract this into a table format for a database so I can use it as a lookup table for some data transformation work I'm working on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried using the tExtractJSONFields component, but unsure how to structure my schema etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To explain how I want this to work, if I were to put this into a CSV, this how I'd want the CSV to look like.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;B&gt;"choice_category","choice_category_type","choice_category_subtype"&lt;/B&gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;B&gt;"type","Admin","Email"&lt;/B&gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;B&gt;"type","Admin","Post"&lt;/B&gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;B&gt;"type","Admin","Filing"&lt;/B&gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;B&gt;"type","Services","Customer Call"&lt;/B&gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;B&gt;"type","Services","Customer Email"&lt;/B&gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;B&gt;"type","Services","Returns"&lt;/B&gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;B&gt;"type","Other",""&lt;/B&gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;B&gt;"type","Training","Online Course"&lt;/B&gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp;&lt;B&gt;"type","Training","Classroom Course"&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is anybody able to assist or give me any pointers at all? I'm a complete novice with this sort of stuff&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;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 23:06:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Help-with-converting-JSON-response-to-table/m-p/2291760#M64913</guid>
      <dc:creator>welshsteve</dc:creator>
      <dc:date>2024-11-15T23:06:49Z</dc:date>
    </item>
    <item>
      <title>Re: Help with converting JSON response to table</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Help-with-converting-JSON-response-to-table/m-p/2291761#M64914</link>
      <description>&lt;P&gt;@Steve Williams​&amp;nbsp;there are multiple array in the Json string, you can't extract all array values with one tExtractJsonField, I think you cache the string in memory and in use different tExtractJsonField components to extract each part in next subjobs, and append the each part to the same file, the job looks like:&lt;/P&gt;&lt;P&gt;tRestClient--main--tHashOutput1&lt;/P&gt;&lt;P&gt;|onsubjobok&lt;/P&gt;&lt;P&gt;tHashinput1--main-tExtractJason2--&amp;gt;-tJavaRow1&lt;/P&gt;&lt;P&gt;|onsubjobok&lt;/P&gt;&lt;P&gt;tHashInput2--main--tExtractJason2--&amp;gt;tMap1--&amp;gt;tFileOutputDelmited1&lt;/P&gt;&lt;P&gt;|onsubjobok&lt;/P&gt;&lt;P&gt;extract data from Services array and append data to the same file&lt;/P&gt;&lt;P&gt;|onsubjobok&lt;/P&gt;&lt;P&gt;extract data from Other array and append data to the same file&lt;/P&gt;&lt;P&gt;|onsubjobok&lt;/P&gt;&lt;P&gt;extract data from Training array and append data to the same file&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;tHashOutput: cache the json string in memory.&lt;/P&gt;&lt;P&gt;tHashInput1: read json string from memory, &lt;/P&gt;&lt;P&gt;tExtractJsonField1: extract choice_category value only&lt;/P&gt;&lt;P&gt;tJavaRow1: store choice_category value to global variable for used later, eg:&lt;/P&gt;&lt;P&gt;globalMap.put("key",input_row.choice_category)&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;tHashInput2: read json string from memory, &lt;/P&gt;&lt;P&gt;tExtractJsonField2: extract &lt;B&gt;choice_category_subtype &lt;/B&gt;value from Admin array.&lt;/P&gt;&lt;P&gt;tMap1: in the output table, add two new column, one is choice_category, set it's expression as:&lt;/P&gt;&lt;P&gt;(String)globalMap.get("key")&lt;/P&gt;&lt;P&gt;another column is choice_category_type, set it's expression as "Admin"&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;other arrays follows the same logic. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shong​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;</description>
      <pubDate>Wed, 16 Mar 2022 10:10:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Help-with-converting-JSON-response-to-table/m-p/2291761#M64914</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-03-16T10:10:08Z</dc:date>
    </item>
  </channel>
</rss>

