<?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 tJavaRow inserting data collection (array) into tXMLMap column in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/tJavaRow-inserting-data-collection-array-into-tXMLMap-column/m-p/2308148#M79514</link>
    <description>Hi everyone, I'm getting some trouble when I try to insert data from tJavaRow in a column from tXMLMap. These columns in tXMLMap should be an array&amp;nbsp; 
&lt;BR /&gt; 
&lt;BR /&gt;1 - I tried to iterate and insert data into output_row[count], but I can't because "confidence" column isn't an array 
&lt;BR /&gt; 
&lt;PRE&gt;for(int count = 0; count &amp;lt; results.getAlternatives().size(); count++)	{&lt;BR /&gt;						&lt;BR /&gt;	// Get object by current count&lt;BR /&gt;	SpeechReturnDTO speech = (SpeechReturnDTO) results.getAlternatives().toArray()[count];&lt;BR /&gt;&lt;BR /&gt;	// Inserting value into tXMLMap&lt;BR /&gt;	output_row.confidence[count] = speech.getConfidence();&lt;BR /&gt;	output_row.transcript[count] = speech.getTranscript();&lt;BR /&gt;					&lt;BR /&gt;}&lt;/PRE&gt; 
&lt;BR /&gt; 
&lt;BR /&gt;2 - I tried to create a body column with some elements, but I couldn't access the variables using tJavaRow 
&lt;BR /&gt; 
&lt;PRE&gt;for(int count = 0; count &amp;lt; results.getAlternatives().size(); count++)	{&lt;BR /&gt;						&lt;BR /&gt;	// Get object by current count&lt;BR /&gt;	SpeechReturnDTO speech = (SpeechReturnDTO) results.getAlternatives().toArray()[count];&lt;BR /&gt;&lt;BR /&gt;	// Inserting value into tXMLMap&lt;BR /&gt;	output_row.body.result.alternative[count].confidence = speech.getConfidence();&lt;BR /&gt;	output_row.body.result.alternative[count].transcript = speech.getTranscript();&lt;/PRE&gt; 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;BR /&gt;Does anyone can help me to fix this problem? 
&lt;BR /&gt; 
&lt;BR /&gt;Thanks in advance 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;I&gt;I've attached files to more information&lt;/I&gt; 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MG9P.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/147697iCB88A5847677ACBE/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MG9P.png" alt="0683p000009MG9P.png" /&gt;&lt;/span&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MG18.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/144795iE294A611FF956CDE/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MG18.png" alt="0683p000009MG18.png" /&gt;&lt;/span&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MG9L.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/128334i97D91055B501BA78/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MG9L.png" alt="0683p000009MG9L.png" /&gt;&lt;/span&gt;</description>
    <pubDate>Sat, 16 Nov 2024 10:10:45 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-11-16T10:10:45Z</dc:date>
    <item>
      <title>tJavaRow inserting data collection (array) into tXMLMap column</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tJavaRow-inserting-data-collection-array-into-tXMLMap-column/m-p/2308148#M79514</link>
      <description>Hi everyone, I'm getting some trouble when I try to insert data from tJavaRow in a column from tXMLMap. These columns in tXMLMap should be an array&amp;nbsp; 
&lt;BR /&gt; 
&lt;BR /&gt;1 - I tried to iterate and insert data into output_row[count], but I can't because "confidence" column isn't an array 
&lt;BR /&gt; 
&lt;PRE&gt;for(int count = 0; count &amp;lt; results.getAlternatives().size(); count++)	{&lt;BR /&gt;						&lt;BR /&gt;	// Get object by current count&lt;BR /&gt;	SpeechReturnDTO speech = (SpeechReturnDTO) results.getAlternatives().toArray()[count];&lt;BR /&gt;&lt;BR /&gt;	// Inserting value into tXMLMap&lt;BR /&gt;	output_row.confidence[count] = speech.getConfidence();&lt;BR /&gt;	output_row.transcript[count] = speech.getTranscript();&lt;BR /&gt;					&lt;BR /&gt;}&lt;/PRE&gt; 
&lt;BR /&gt; 
&lt;BR /&gt;2 - I tried to create a body column with some elements, but I couldn't access the variables using tJavaRow 
&lt;BR /&gt; 
&lt;PRE&gt;for(int count = 0; count &amp;lt; results.getAlternatives().size(); count++)	{&lt;BR /&gt;						&lt;BR /&gt;	// Get object by current count&lt;BR /&gt;	SpeechReturnDTO speech = (SpeechReturnDTO) results.getAlternatives().toArray()[count];&lt;BR /&gt;&lt;BR /&gt;	// Inserting value into tXMLMap&lt;BR /&gt;	output_row.body.result.alternative[count].confidence = speech.getConfidence();&lt;BR /&gt;	output_row.body.result.alternative[count].transcript = speech.getTranscript();&lt;/PRE&gt; 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;BR /&gt;Does anyone can help me to fix this problem? 
&lt;BR /&gt; 
&lt;BR /&gt;Thanks in advance 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;I&gt;I've attached files to more information&lt;/I&gt; 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MG9P.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/147697iCB88A5847677ACBE/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MG9P.png" alt="0683p000009MG9P.png" /&gt;&lt;/span&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MG18.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/144795iE294A611FF956CDE/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MG18.png" alt="0683p000009MG18.png" /&gt;&lt;/span&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MG9L.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/128334i97D91055B501BA78/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MG9L.png" alt="0683p000009MG9L.png" /&gt;&lt;/span&gt;</description>
      <pubDate>Sat, 16 Nov 2024 10:10:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tJavaRow-inserting-data-collection-array-into-tXMLMap-column/m-p/2308148#M79514</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T10:10:45Z</dc:date>
    </item>
    <item>
      <title>Re: tJavaRow inserting data collection (array) into tXMLMap column</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tJavaRow-inserting-data-collection-array-into-tXMLMap-column/m-p/2308149#M79515</link>
      <description>Hi&amp;nbsp; 
&lt;BR /&gt;What are your input data? What are your expected result? I DON'T know why you need to hard code on tJavaRow, can you please explain your requirement with more details? 
&lt;BR /&gt; 
&lt;BR /&gt;Regards 
&lt;BR /&gt;Shong</description>
      <pubDate>Thu, 29 Dec 2016 08:52:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tJavaRow-inserting-data-collection-array-into-tXMLMap-column/m-p/2308149#M79515</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-12-29T08:52:51Z</dc:date>
    </item>
    <item>
      <title>Re: tJavaRow inserting data collection (array) into tXMLMap column</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tJavaRow-inserting-data-collection-array-into-tXMLMap-column/m-p/2308150#M79516</link>
      <description>I'm integrating my software with Google Speech to Text Api.&amp;nbsp;
&lt;BR /&gt;1 - I make an HTTP request POST to Talend sending 2 datas: audio file and language as input
&lt;BR /&gt;2 - Process data using my library in tJavaRow component and iterate with collection result&amp;nbsp;
&lt;BR /&gt;3 - Inside the iteration (tJavaRow) I would like to insert current data from iteration in a &amp;nbsp;"array variable" inside tXMLMap, but I can't because when I try to access "output_row.confidence[0]", it IS NOT an array.
&lt;BR /&gt;
&lt;BR /&gt;For instance:
&lt;BR /&gt;I have two data and I need to put the same data inside a tXMLMap
&lt;BR /&gt;Input (tJavaRow) -&amp;gt; &amp;nbsp; &amp;nbsp;alternative[0] = { confidence = 0.954564, transcript = "Hi how are you"}
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;alternative[1] = { confidence = 0.846132, transcript = "I'm testing" }
&lt;BR /&gt;Output (tXMLMap) -&amp;gt; &amp;nbsp;(the same data above)
&lt;BR /&gt;
&lt;BR /&gt;I need something like this:&amp;nbsp;
&lt;BR /&gt;
&lt;PRE&gt;// Copying first data&lt;BR /&gt;output_row[0].confidence =&amp;nbsp;alternative[0].confidence;&lt;BR /&gt;output_row[0].transcript =&amp;nbsp;alternative[0].transcript;&lt;BR /&gt;&lt;BR /&gt;// Copying second data&lt;BR /&gt;output_row[1].confidence =&amp;nbsp;alternative[1].confidence;&lt;BR /&gt;output_row[1].confidence =&amp;nbsp;alternative[1].confidence;&lt;BR /&gt;&lt;BR /&gt;// and so on...&lt;BR /&gt;&lt;/PRE&gt;
&lt;BR /&gt;&amp;nbsp;Let me know if I could be clearer with my question.
&lt;BR /&gt;&amp;nbsp;Thanks in advance
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;
&lt;BR /&gt;
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;</description>
      <pubDate>Thu, 29 Dec 2016 10:50:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tJavaRow-inserting-data-collection-array-into-tXMLMap-column/m-p/2308150#M79516</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-12-29T10:50:23Z</dc:date>
    </item>
    <item>
      <title>Re: tJavaRow inserting data collection (array) into tXMLMap column</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tJavaRow-inserting-data-collection-array-into-tXMLMap-column/m-p/2308151#M79517</link>
      <description>Hi 
&lt;BR /&gt;The output column is not an array, I suggest you to iterate each item and append it to a string (eg:&amp;nbsp;confidence1,confidence2,...)&amp;nbsp;as output column on tJavaRow, and then normalize this column with tNormalize component to becomes: 
&lt;BR /&gt;other column;confidence1;transcript1 
&lt;BR /&gt;other column;confidence2;transcript2 
&lt;BR /&gt;other column;confidence3;transcript3 
&lt;BR /&gt; 
&lt;BR /&gt;Regards 
&lt;BR /&gt;Shong</description>
      <pubDate>Fri, 30 Dec 2016 00:54:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tJavaRow-inserting-data-collection-array-into-tXMLMap-column/m-p/2308151#M79517</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-12-30T00:54:35Z</dc:date>
    </item>
  </channel>
</rss>

