<?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: using tExtractJsonFields to extract JSON response from tRestClient in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/using-tExtractJsonFields-to-extract-JSON-response-from/m-p/2226485#M18384</link>
    <description>Hi&amp;nbsp; 
&lt;BR /&gt;Check the response string to see which key it contains, and use the corresponding tExtractJsonFields to parse the string. Eg: 
&lt;BR /&gt;.....tJavaRow--runIf1---tFixedFlowInput1--main--tExtractJsonFields1 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; --runIf2---tFixedFlowInput2--main---tExtractJsonFields2 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;... 
&lt;BR /&gt;on tJavaRow: 
&lt;BR /&gt;if(input_row.response.contains(" 
&lt;FONT size="2"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;apple:ios&lt;/FONT&gt;&lt;/FONT&gt;")){ 
&lt;BR /&gt;globalMap.put("is 
&lt;FONT size="2"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;apple:ios",true);&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT size="2"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;}else{&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt;globalMap.put("is 
&lt;FONT size="2"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;apple:ios",false);&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT size="2"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;}&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;BR /&gt;if(input_row.response.contains(" 
&lt;FONT size="2"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;google_play&lt;/FONT&gt;&lt;/FONT&gt;")){ 
&lt;BR /&gt;globalMap.put("is 
&lt;FONT size="2"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;google_play&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;FONT size="2"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;",true);&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT size="2"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;}else{&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt;globalMap.put("is 
&lt;FONT size="2"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;google_play&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;FONT size="2"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;",false);&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT size="2"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;}&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;FONT size="2"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;...&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;FONT size="2"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;set the condition of runif1 as:&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;&lt;FONT size="2"&gt;(Boolean)globalMap.get("&lt;/FONT&gt;&lt;/FONT&gt;is 
&lt;FONT size="2"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;apple:ios&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;FONT size="2"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;")&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;BR /&gt;tExtractJsonFields1: configure to extract the values from the json string whose key is&amp;nbsp; 
&lt;FONT size="2"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;apple:ios.&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt;This solution is only apply to the situation the number of keys is limited, and the key can be one of the values which is listed on tJavaRow. 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;FONT size="2"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;Best regards&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT size="2"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;Shong&lt;/FONT&gt;&lt;/FONT&gt;</description>
    <pubDate>Thu, 05 Nov 2015 02:06:48 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-11-05T02:06:48Z</dc:date>
    <item>
      <title>using tExtractJsonFields to extract JSON response from tRestClient</title>
      <link>https://community.qlik.com/t5/Talend-Studio/using-tExtractJsonFields-to-extract-JSON-response-from/m-p/2226484#M18383</link>
      <description>Hi, 
&lt;BR /&gt;I am trying to tExtractJsonFields to parse the JSON response. But JSON response has dynamic keys. &amp;nbsp;How to parse this kind of JSON using tExtractJSONfields. I am using community edition of data integrator 5.5. 
&lt;BR /&gt;Following is an example 
&lt;BR /&gt;{ 
&lt;BR /&gt;&amp;nbsp; "apple:ios": { 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "2015-10-20": { 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "downloads": 72, 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "updates": 27, 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "returns": 0, 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "net_downloads": 72, 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "promos": 0, 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "revenue": "0.00", 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "edu_downloads": 0, 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "gifts": 0, 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "gift_redemptions": 0, 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "storefront": "apple:ios", 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "store": "apple", 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "date": "2015-10-20" 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; } 
&lt;BR /&gt;&amp;nbsp; }, 
&lt;BR /&gt;&amp;nbsp; "google_play": { 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "2015-10-20": { 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "downloads": 68, 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "updates": 14, 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "returns": 0, 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "net_downloads": 68, 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "promos": 0, 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "revenue": "0.00", 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "edu_downloads": 0, 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "gifts": 0, 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "gift_redemptions": 0, 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "storefront": "google_play", 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "store": "google_play", 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "date": "2015-10-20" 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; } 
&lt;BR /&gt;&amp;nbsp; } 
&lt;BR /&gt;}</description>
      <pubDate>Wed, 28 Oct 2015 23:07:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/using-tExtractJsonFields-to-extract-JSON-response-from/m-p/2226484#M18383</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-10-28T23:07:44Z</dc:date>
    </item>
    <item>
      <title>Re: using tExtractJsonFields to extract JSON response from tRestClient</title>
      <link>https://community.qlik.com/t5/Talend-Studio/using-tExtractJsonFields-to-extract-JSON-response-from/m-p/2226485#M18384</link>
      <description>Hi&amp;nbsp; 
&lt;BR /&gt;Check the response string to see which key it contains, and use the corresponding tExtractJsonFields to parse the string. Eg: 
&lt;BR /&gt;.....tJavaRow--runIf1---tFixedFlowInput1--main--tExtractJsonFields1 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; --runIf2---tFixedFlowInput2--main---tExtractJsonFields2 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;... 
&lt;BR /&gt;on tJavaRow: 
&lt;BR /&gt;if(input_row.response.contains(" 
&lt;FONT size="2"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;apple:ios&lt;/FONT&gt;&lt;/FONT&gt;")){ 
&lt;BR /&gt;globalMap.put("is 
&lt;FONT size="2"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;apple:ios",true);&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT size="2"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;}else{&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt;globalMap.put("is 
&lt;FONT size="2"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;apple:ios",false);&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT size="2"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;}&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;BR /&gt;if(input_row.response.contains(" 
&lt;FONT size="2"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;google_play&lt;/FONT&gt;&lt;/FONT&gt;")){ 
&lt;BR /&gt;globalMap.put("is 
&lt;FONT size="2"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;google_play&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;FONT size="2"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;",true);&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT size="2"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;}else{&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt;globalMap.put("is 
&lt;FONT size="2"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;google_play&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;FONT size="2"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;",false);&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT size="2"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;}&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;FONT size="2"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;...&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;FONT size="2"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;set the condition of runif1 as:&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;&lt;FONT size="2"&gt;(Boolean)globalMap.get("&lt;/FONT&gt;&lt;/FONT&gt;is 
&lt;FONT size="2"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;apple:ios&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;FONT size="2"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;")&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;BR /&gt;tExtractJsonFields1: configure to extract the values from the json string whose key is&amp;nbsp; 
&lt;FONT size="2"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;apple:ios.&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt;This solution is only apply to the situation the number of keys is limited, and the key can be one of the values which is listed on tJavaRow. 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;FONT size="2"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;Best regards&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT size="2"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;Shong&lt;/FONT&gt;&lt;/FONT&gt;</description>
      <pubDate>Thu, 05 Nov 2015 02:06:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/using-tExtractJsonFields-to-extract-JSON-response-from/m-p/2226485#M18384</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-05T02:06:48Z</dc:date>
    </item>
  </channel>
</rss>

