<?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: Unable to parse JSON &amp;quot;name&amp;quot; using tExtractJSON in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Unable-to-parse-JSON-quot-name-quot-using-tExtractJSON/m-p/2253869#M37056</link>
    <description>&lt;P&gt;Thank you for this; this is great!&lt;/P&gt;</description>
    <pubDate>Wed, 21 Nov 2018 16:40:19 GMT</pubDate>
    <dc:creator>zalibra</dc:creator>
    <dc:date>2018-11-21T16:40:19Z</dc:date>
    <item>
      <title>Unable to parse JSON "name" using tExtractJSON</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Unable-to-parse-JSON-quot-name-quot-using-tExtractJSON/m-p/2253866#M37053</link>
      <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I'm trying to parse the JSON pairs "name" from the below string but none of the combinations I used in tExtractJSON worked (I used both JsonPath and Xpath and nothing works).&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;{"server_time":1535722727,"pairs":{"eur_usd":{"decimal_places":8,"min_price":0.00000001,"max_price":2.0,"min_amount":0.00000001,"max_amount":1000000.0,"min_total":0.0001,"hidden":0,"fee":0.25},"chf_usd":{"decimal_places":8,"min_price":0.00000001,"max_price":2.0,"min_amount":0.001,"max_amount":1000000000.0,"min_total":0.0001,"hidden":1,"fee":0.25},"jpy_usd":{"decimal_places":8,"min_price":0.00000001,"max_price":2.0,"min_amount":0.001,"max_amount":1000000000.0,"min_total":0.0001,"hidden":1,"fee":0.25}&lt;/PRE&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I'm trying to get just the pairs names: "eur_usd", "chf_usd", "jpy_usd". Any help would be greatly appreciated.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Aug 2018 15:28:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Unable-to-parse-JSON-quot-name-quot-using-tExtractJSON/m-p/2253866#M37053</guid>
      <dc:creator>zalibra</dc:creator>
      <dc:date>2018-08-31T15:28:22Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to parse JSON "name" using tExtractJSON</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Unable-to-parse-JSON-quot-name-quot-using-tExtractJSON/m-p/2253867#M37054</link>
      <description>&lt;P&gt;-- edited&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;because You need Keys names, it not possible todo with standard Talend components&lt;/P&gt;&lt;P&gt;but possible with tJava&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can search on forum, but I can try to &amp;nbsp;find example from past project&lt;/P&gt;</description>
      <pubDate>Mon, 17 Sep 2018 14:18:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Unable-to-parse-JSON-quot-name-quot-using-tExtractJSON/m-p/2253867#M37054</guid>
      <dc:creator>vapukov</dc:creator>
      <dc:date>2018-09-17T14:18:28Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to parse JSON "name" using tExtractJSON</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Unable-to-parse-JSON-quot-name-quot-using-tExtractJSON/m-p/2253868#M37055</link>
      <description>&lt;P&gt;something like:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2018-09-18 at 02.23.50.png" style="width: 400px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M0D5.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/145193iEA6C7F6377ED862A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M0D5.png" alt="0683p000009M0D5.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;use tLibrayLoad for - javax.json-api-1.1.2.jar&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;1st tJavaFlex&lt;/P&gt; 
&lt;PRE&gt;import java.util.*;
import javax.json.*;

JSONObject object = new JSONObject(row4.line);
String[] keys = JSONObject.getNames(object);

for (String key : keys)
{
    Object value = object.get(key);
}

globalMap.put("array_size", keys.length);

List keylist = Arrays.asList(keys);
globalMap.put("vk",keylist);&lt;/PRE&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;2nd tJavaFlex:&lt;/P&gt; 
&lt;PRE&gt;List&amp;lt;String&amp;gt; alist = (List&amp;lt;String&amp;gt;)globalMap.get("vk");

Integer ii = ((Integer)globalMap.get("tLoop_1_CURRENT_ITERATION"))-1;

globalMap.put("jkey",alist.get(ii));&lt;/PRE&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2018-09-18 at 02.29.09.png" style="width: 400px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M0DO.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/129238i213784DE7890EC5C/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M0DO.png" alt="0683p000009M0DO.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;it iterate&amp;nbsp;over pair and put each key name into global variable for use on feature steps&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2018-09-18 at 02.30.36.png" style="width: 400px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M0HU.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/139645i9C9425A1495DE393/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M0HU.png" alt="0683p000009M0HU.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Sep 2018 15:31:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Unable-to-parse-JSON-quot-name-quot-using-tExtractJSON/m-p/2253868#M37055</guid>
      <dc:creator>vapukov</dc:creator>
      <dc:date>2018-09-17T15:31:09Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to parse JSON "name" using tExtractJSON</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Unable-to-parse-JSON-quot-name-quot-using-tExtractJSON/m-p/2253869#M37056</link>
      <description>&lt;P&gt;Thank you for this; this is great!&lt;/P&gt;</description>
      <pubDate>Wed, 21 Nov 2018 16:40:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Unable-to-parse-JSON-quot-name-quot-using-tExtractJSON/m-p/2253869#M37056</guid>
      <dc:creator>zalibra</dc:creator>
      <dc:date>2018-11-21T16:40:19Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to parse JSON "name" using tExtractJSON</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Unable-to-parse-JSON-quot-name-quot-using-tExtractJSON/m-p/2253870#M37057</link>
      <description>&lt;P&gt;Hi vapukov, &lt;/P&gt;&lt;P&gt;I have similar question where I need to extract pair_names, values of decimal_places, min_price etc and insert it in the db table, then how do I go about it? &lt;/P&gt;&lt;P&gt;, &lt;/P&gt;</description>
      <pubDate>Mon, 04 Sep 2023 12:57:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Unable-to-parse-JSON-quot-name-quot-using-tExtractJSON/m-p/2253870#M37057</guid>
      <dc:creator>JYeola</dc:creator>
      <dc:date>2023-09-04T12:57:25Z</dc:date>
    </item>
  </channel>
</rss>

