<?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 rREST output with multiple fields in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/rREST-output-with-multiple-fields/m-p/2241585#M28686</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to build a job where one field is a text field which is being translated using tREST and Google Translate API. The second field is the key(id) assiciated with the text field. However, the output of the tREST component yields just the fields "Body"(with translated text in JSON format) and "ERROR_CODE". My objective is to load the output into a database. How can I do this while keeping the key associated with each translated text row?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Desired output format:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ID&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;TEXT&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;abcdefg&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;bcdefgh&lt;/P&gt;&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cdefgh&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BR&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Lars&lt;/P&gt;</description>
    <pubDate>Wed, 06 Nov 2019 15:38:32 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-11-06T15:38:32Z</dc:date>
    <item>
      <title>rREST output with multiple fields</title>
      <link>https://community.qlik.com/t5/Talend-Studio/rREST-output-with-multiple-fields/m-p/2241585#M28686</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to build a job where one field is a text field which is being translated using tREST and Google Translate API. The second field is the key(id) assiciated with the text field. However, the output of the tREST component yields just the fields "Body"(with translated text in JSON format) and "ERROR_CODE". My objective is to load the output into a database. How can I do this while keeping the key associated with each translated text row?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Desired output format:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ID&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;TEXT&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;abcdefg&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;bcdefgh&lt;/P&gt;&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cdefgh&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BR&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Lars&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2019 15:38:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/rREST-output-with-multiple-fields/m-p/2241585#M28686</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-06T15:38:32Z</dc:date>
    </item>
    <item>
      <title>Re: rREST output with multiple fields</title>
      <link>https://community.qlik.com/t5/Talend-Studio/rREST-output-with-multiple-fields/m-p/2241586#M28687</link>
      <description>&lt;P&gt;I'm assuming your data (ID and TEXT) are coming from a DB or a flat file. In this case, read in your data from your source and connect it to a tFlowToIterate component. This will save each row in the globalMap using the row name and the column name as a key to each column. If your row from your source component is "row1" and your column names are "ID" and "TEXT", you can retrieve those values using ....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;((String)globalMap.get("row1.TEXT"))&lt;/PRE&gt;
&lt;P&gt;....for TEXT and ...&lt;/P&gt;
&lt;PRE&gt;((Integer)globalMap.get("row1.ID"))&lt;/PRE&gt;
&lt;P&gt;...for ID. I am assuming that ID is an Integer and TEXT is a String here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After your tFlowToIterate you would add a tJava component as a dummy component. This is because you cannot link to a tRestClient component with an Iterate link. In your tRestClient component you can use your TEXT value in your URL by appending the following code to your URL....&lt;/P&gt;
&lt;PRE&gt;"Your url...../"+((String)globalMap.get("row1.TEXT"))&lt;/PRE&gt;
&lt;P&gt;Then after your tRestClient, you can add a tMap to link your returned data with its original value (if necessary) and its ID by adding output columns for the ID and original TEXT. You would use the globalMap code I have shown above for this.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2019 18:10:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/rREST-output-with-multiple-fields/m-p/2241586#M28687</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-06T18:10:51Z</dc:date>
    </item>
    <item>
      <title>Re: rREST output with multiple fields</title>
      <link>https://community.qlik.com/t5/Talend-Studio/rREST-output-with-multiple-fields/m-p/2241587#M28688</link>
      <description>&lt;P&gt;Hi rhall_2_0!&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thanks for your advice - it worked just fine &lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACn.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154443iC5B8CACEF3D12C6A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACn.png" alt="0683p000009MACn.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2019 16:47:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/rREST-output-with-multiple-fields/m-p/2241587#M28688</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-13T16:47:33Z</dc:date>
    </item>
  </channel>
</rss>

