<?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 Issue with TextractJSONField - Read by Xpath in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Issue-with-TextractJSONField-Read-by-Xpath/m-p/2309051#M80314</link>
    <description>&lt;P&gt;I&amp;nbsp;have a requirement of&amp;nbsp;pulling data from&amp;nbsp;RestAPI and putting it into database. I created below&amp;nbsp;mentioned job&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;tRestClient--&amp;gt;TextractJSONFields--&amp;gt;tLogRow--&amp;gt;tOracleOutput.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Sample JSON&lt;/P&gt;
&lt;P&gt;{&lt;BR /&gt;"chats":[&lt;BR /&gt;{&lt;/P&gt;
&lt;P&gt;"id":"2001",&lt;BR /&gt;"comment": null,&lt;BR /&gt;"triggered_response": true,&lt;/P&gt;
&lt;P&gt;"visitor":"&lt;SPAN&gt;Guest1&lt;/SPAN&gt;",&lt;BR /&gt;"history": [&lt;BR /&gt;{&lt;BR /&gt;"name": "Guest1",&lt;BR /&gt;"msg_id": "1534494221340",&lt;BR /&gt;"msg": "Test message from Guest",&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;"name": "Support",&lt;BR /&gt;"msg_id": "1534494221340",&lt;BR /&gt;"msg": "Test message from support"&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;"count": 179049,&lt;BR /&gt;"next_url": "www.nexturl..."&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The loop is on the history where I have to get all the chat messages for each&amp;nbsp;visitor. For this I have used the&lt;/P&gt;
&lt;P&gt;tExtractJSONField&lt;/P&gt;
&lt;P&gt;Read By : Xpath&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Loop XPathQuery :&amp;nbsp;"/chats/history[*]"&lt;/P&gt;
&lt;P&gt;Mappin&lt;/P&gt;
&lt;P&gt;Column&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xPathQuery&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ChatID&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"../id"&lt;/P&gt;
&lt;P&gt;Chat_Text&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;"msg"&lt;/P&gt;
&lt;P&gt;Chat_Text_By&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"name"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Everything works fine except sometimes the&amp;nbsp;chat will have attachments and there are extra elements to 'history'&amp;nbsp;and JSON looks like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;{&lt;BR /&gt;"chats":[&lt;BR /&gt;{&lt;/P&gt;
&lt;P&gt;"id":"2001"&lt;BR /&gt;"comment": null,&lt;BR /&gt;"triggered_response": true,&lt;BR /&gt;"history": [&lt;BR /&gt;{&lt;BR /&gt;"name": "Guest1",&lt;BR /&gt;"msg_id": "1534494221340",&lt;BR /&gt;"msg": "Test message from Guest",&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;"name": "Support",&lt;BR /&gt;"msg_id": "1534494221340",&lt;BR /&gt;"msg": "Test message from support"&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;"attachment": {&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;"mime_type$string": "image/jpeg",&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;"name$string": "image.jpg",&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;"url$string": "image_url"&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;"count": 179049,&lt;BR /&gt;"next_url": "www.nexturl..."&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;whenever this appears in&amp;nbsp;output the job&amp;nbsp;gives error&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;&lt;EM&gt;&lt;FONT color="#FF0000"&gt;Error on line 28 of document&amp;nbsp; : Element type "mime_type" must be followed by either attribute specifications, "&amp;gt;" or "/&amp;gt;". Nested exception: Element type "mime_type" must be followed by either attribute specifications, "&amp;gt;" or "/&amp;gt;".&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I use Read By : JsonPath and supply JSON&amp;nbsp;query there is no error but the parent elements to looping elements do not appear in result&lt;/P&gt;
&lt;P&gt;tExtractJSONField Properties&lt;/P&gt;
&lt;P&gt;Read By :&amp;nbsp;JsonPath&lt;/P&gt;
&lt;P&gt;Loop XPathQuery : "$.chats[*].history[*]"&lt;/P&gt;
&lt;P&gt;Mappin&lt;/P&gt;
&lt;P&gt;Column&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Json Query&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ChatID&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;SPAN&gt;"$.chats[*].&lt;/SPAN&gt;id"&lt;/P&gt;
&lt;P&gt;Chat_Text&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;"msg"&lt;/P&gt;
&lt;P&gt;Chat_Text_By&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"name"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So there are two issues I am looking for help&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) tExtractJSONFields with XPath option gives error when JASON output contains&amp;nbsp;"$" in element name&lt;/P&gt;
&lt;P&gt;2)&amp;nbsp;&lt;SPAN&gt;tExtractJSONFields with JsonPath&amp;nbsp;option&amp;nbsp;does not give parent element data when loop jasonpath query is used&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 17 Aug 2018 12:34:43 GMT</pubDate>
    <dc:creator>Gourav_King_of_DataLand</dc:creator>
    <dc:date>2018-08-17T12:34:43Z</dc:date>
    <item>
      <title>Issue with TextractJSONField - Read by Xpath</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Issue-with-TextractJSONField-Read-by-Xpath/m-p/2309051#M80314</link>
      <description>&lt;P&gt;I&amp;nbsp;have a requirement of&amp;nbsp;pulling data from&amp;nbsp;RestAPI and putting it into database. I created below&amp;nbsp;mentioned job&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;tRestClient--&amp;gt;TextractJSONFields--&amp;gt;tLogRow--&amp;gt;tOracleOutput.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Sample JSON&lt;/P&gt;
&lt;P&gt;{&lt;BR /&gt;"chats":[&lt;BR /&gt;{&lt;/P&gt;
&lt;P&gt;"id":"2001",&lt;BR /&gt;"comment": null,&lt;BR /&gt;"triggered_response": true,&lt;/P&gt;
&lt;P&gt;"visitor":"&lt;SPAN&gt;Guest1&lt;/SPAN&gt;",&lt;BR /&gt;"history": [&lt;BR /&gt;{&lt;BR /&gt;"name": "Guest1",&lt;BR /&gt;"msg_id": "1534494221340",&lt;BR /&gt;"msg": "Test message from Guest",&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;"name": "Support",&lt;BR /&gt;"msg_id": "1534494221340",&lt;BR /&gt;"msg": "Test message from support"&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;"count": 179049,&lt;BR /&gt;"next_url": "www.nexturl..."&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The loop is on the history where I have to get all the chat messages for each&amp;nbsp;visitor. For this I have used the&lt;/P&gt;
&lt;P&gt;tExtractJSONField&lt;/P&gt;
&lt;P&gt;Read By : Xpath&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Loop XPathQuery :&amp;nbsp;"/chats/history[*]"&lt;/P&gt;
&lt;P&gt;Mappin&lt;/P&gt;
&lt;P&gt;Column&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xPathQuery&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ChatID&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"../id"&lt;/P&gt;
&lt;P&gt;Chat_Text&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;"msg"&lt;/P&gt;
&lt;P&gt;Chat_Text_By&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"name"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Everything works fine except sometimes the&amp;nbsp;chat will have attachments and there are extra elements to 'history'&amp;nbsp;and JSON looks like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;{&lt;BR /&gt;"chats":[&lt;BR /&gt;{&lt;/P&gt;
&lt;P&gt;"id":"2001"&lt;BR /&gt;"comment": null,&lt;BR /&gt;"triggered_response": true,&lt;BR /&gt;"history": [&lt;BR /&gt;{&lt;BR /&gt;"name": "Guest1",&lt;BR /&gt;"msg_id": "1534494221340",&lt;BR /&gt;"msg": "Test message from Guest",&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;"name": "Support",&lt;BR /&gt;"msg_id": "1534494221340",&lt;BR /&gt;"msg": "Test message from support"&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;"attachment": {&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;"mime_type$string": "image/jpeg",&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;"name$string": "image.jpg",&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;"url$string": "image_url"&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;"count": 179049,&lt;BR /&gt;"next_url": "www.nexturl..."&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;whenever this appears in&amp;nbsp;output the job&amp;nbsp;gives error&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;&lt;EM&gt;&lt;FONT color="#FF0000"&gt;Error on line 28 of document&amp;nbsp; : Element type "mime_type" must be followed by either attribute specifications, "&amp;gt;" or "/&amp;gt;". Nested exception: Element type "mime_type" must be followed by either attribute specifications, "&amp;gt;" or "/&amp;gt;".&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I use Read By : JsonPath and supply JSON&amp;nbsp;query there is no error but the parent elements to looping elements do not appear in result&lt;/P&gt;
&lt;P&gt;tExtractJSONField Properties&lt;/P&gt;
&lt;P&gt;Read By :&amp;nbsp;JsonPath&lt;/P&gt;
&lt;P&gt;Loop XPathQuery : "$.chats[*].history[*]"&lt;/P&gt;
&lt;P&gt;Mappin&lt;/P&gt;
&lt;P&gt;Column&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Json Query&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ChatID&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;SPAN&gt;"$.chats[*].&lt;/SPAN&gt;id"&lt;/P&gt;
&lt;P&gt;Chat_Text&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;"msg"&lt;/P&gt;
&lt;P&gt;Chat_Text_By&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"name"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So there are two issues I am looking for help&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) tExtractJSONFields with XPath option gives error when JASON output contains&amp;nbsp;"$" in element name&lt;/P&gt;
&lt;P&gt;2)&amp;nbsp;&lt;SPAN&gt;tExtractJSONFields with JsonPath&amp;nbsp;option&amp;nbsp;does not give parent element data when loop jasonpath query is used&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Aug 2018 12:34:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Issue-with-TextractJSONField-Read-by-Xpath/m-p/2309051#M80314</guid>
      <dc:creator>Gourav_King_of_DataLand</dc:creator>
      <dc:date>2018-08-17T12:34:43Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with TextractJSONField - Read by Xpath</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Issue-with-TextractJSONField-Read-by-Xpath/m-p/2309052#M80315</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Have you tried to use tfileinputjson component with&amp;nbsp;XPath option and&lt;SPAN&gt; JsonPath&lt;/SPAN&gt; to read your sample json to see if this two issues repro?&lt;/P&gt;
&lt;P&gt;Best regards&lt;/P&gt;
&lt;P&gt;Sabrina&lt;/P&gt;</description>
      <pubDate>Tue, 28 Aug 2018 10:56:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Issue-with-TextractJSONField-Read-by-Xpath/m-p/2309052#M80315</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-08-28T10:56:10Z</dc:date>
    </item>
  </channel>
</rss>

