<?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: Parsing a JSON  from trestclient response in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Parsing-a-JSON-from-trestclient-response/m-p/2270006#M48060</link>
    <description>&lt;P&gt;You appear to be using XPath for this. It might be easier to use JsonPath and set your loop to.....&lt;/P&gt;
&lt;PRE&gt;"$.&lt;SPAN&gt;eventi_carichi&lt;/SPAN&gt;[*]"&lt;/PRE&gt;
&lt;P&gt;If you are regularly working with JSON it makes sense not to rely on XPath. There are certain pieces of functionality that do not translate between JSONPath and XPath.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 27 Jan 2020 14:36:56 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-01-27T14:36:56Z</dc:date>
    <item>
      <title>Parsing a JSON  from trestclient response</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Parsing-a-JSON-from-trestclient-response/m-p/2270005#M48059</link>
      <description>&lt;P&gt;Hello Everybody,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I need to parse a JSON from&amp;nbsp; TrestClient and save the data into a table.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;This is an example of my JSON:&lt;/P&gt; 
&lt;P&gt;{"eventi_carichi":[{&lt;BR /&gt;"codice_base":"6111",&lt;BR /&gt;"id_evento":0,&lt;BR /&gt;"data_viaggio":"2020-01-24T00:00:00",&lt;BR /&gt;"numero_viaggio":293137,&lt;BR /&gt;"nome_autista":"MARIO",&lt;BR /&gt;"motrice":"AAA123",&lt;BR /&gt;"rimorchio":"BBB456",&lt;BR /&gt;"ora_inizio":"07:33:05",&lt;BR /&gt;"ora_fine":"07:44:38",&lt;BR /&gt;"durata":693,&lt;BR /&gt;"codice_prodotto":"SSP",&lt;BR /&gt;"litri_programmati":9000,&lt;BR /&gt;"litri_erogati":9001,&lt;BR /&gt;"litri15_erogati":9087,&lt;BR /&gt;"densita_ambiente":0.0,&lt;BR /&gt;"densita15":0.7247&lt;BR /&gt;},&lt;BR /&gt;{"codice_base":"6111",&lt;BR /&gt;"id_evento":0,&lt;BR /&gt;"data_viaggio":"2020-01-24T00:00:00",&lt;BR /&gt;"numero_viaggio":293137,&lt;BR /&gt;"nome_autista":"CARLO",&lt;BR /&gt;"motrice":"CCC987",&lt;BR /&gt;"rimorchio":"DDD856",&lt;BR /&gt;"ora_inizio":"07:33:05",&lt;BR /&gt;"ora_fine":"07:51:26",&lt;BR /&gt;"durata":1101,&lt;BR /&gt;"codice_prodotto":"GAS",&lt;BR /&gt;"litri_programmati":27000,&lt;BR /&gt;"litri_erogati":27003,&lt;BR /&gt;"litri15_erogati":27011,&lt;BR /&gt;"densita_ambiente":0.0,&lt;BR /&gt;"densita15":0.841}&lt;BR /&gt;]&lt;BR /&gt;}&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;this is how i'm trying to do it:&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="SCREEEN1.png" style="width: 941px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M8sh.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/140392i64C398B315DA25DE/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M8sh.png" alt="0683p000009M8sh.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&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="screen2.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M8sm.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/155265i111BDF29A2751BD9/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M8sm.png" alt="0683p000009M8sm.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;But I am getting the following error:&lt;/P&gt; 
&lt;P&gt;JSONObject text must begin with '{' at character 1 of "{\"eventi_carichi\":[{\"codice_base\":.....&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;Any ideas?? I'm going crazy!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2020 09:16:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Parsing-a-JSON-from-trestclient-response/m-p/2270005#M48059</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-01-27T09:16:50Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing a JSON  from trestclient response</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Parsing-a-JSON-from-trestclient-response/m-p/2270006#M48060</link>
      <description>&lt;P&gt;You appear to be using XPath for this. It might be easier to use JsonPath and set your loop to.....&lt;/P&gt;
&lt;PRE&gt;"$.&lt;SPAN&gt;eventi_carichi&lt;/SPAN&gt;[*]"&lt;/PRE&gt;
&lt;P&gt;If you are regularly working with JSON it makes sense not to rely on XPath. There are certain pieces of functionality that do not translate between JSONPath and XPath.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2020 14:36:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Parsing-a-JSON-from-trestclient-response/m-p/2270006#M48060</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-01-27T14:36:56Z</dc:date>
    </item>
  </channel>
</rss>

