<?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 How to include the assigned value in context variables to tJavaRow in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/How-to-include-the-assigned-value-in-context-variables-to/m-p/2376382#M144409</link>
    <description>&lt;P&gt;How do I include the value of contexts in tjavarow?&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;For Example:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;This is my job tFileInputDelimited==Main==&amp;gt;tJavaRow==Main==&amp;gt;tFileOutputJSON&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to convert a normal text file into a JSON file, this is my text input:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Document,Files (Header)&lt;BR /&gt;doc_1, 2 (values)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And my output should be like this:&lt;/P&gt;
&lt;P&gt;[{"Document":"doc_1 &lt;STRONG&gt;20180914&lt;/STRONG&gt;","Files":2}]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, My issue is when I try to include the date value through context it projects me a null value like this:&lt;/P&gt;
&lt;P&gt;[{"Document":"doc_1 &lt;STRONG&gt;null&lt;/STRONG&gt;","Files":2}]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is the code I'm following in tJavaRow to implement it:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;output_row.Document = input_row.Document+" "+context.date;&lt;BR /&gt;output_row.Files = Integer.parseInt(input_row.Files);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, I've attached a screenshot, where I need that value in instead of null in my JSON output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can Anyone help me with this?&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 07:30:11 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-11-16T07:30:11Z</dc:date>
    <item>
      <title>How to include the assigned value in context variables to tJavaRow</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-include-the-assigned-value-in-context-variables-to/m-p/2376382#M144409</link>
      <description>&lt;P&gt;How do I include the value of contexts in tjavarow?&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;For Example:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;This is my job tFileInputDelimited==Main==&amp;gt;tJavaRow==Main==&amp;gt;tFileOutputJSON&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to convert a normal text file into a JSON file, this is my text input:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Document,Files (Header)&lt;BR /&gt;doc_1, 2 (values)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And my output should be like this:&lt;/P&gt;
&lt;P&gt;[{"Document":"doc_1 &lt;STRONG&gt;20180914&lt;/STRONG&gt;","Files":2}]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, My issue is when I try to include the date value through context it projects me a null value like this:&lt;/P&gt;
&lt;P&gt;[{"Document":"doc_1 &lt;STRONG&gt;null&lt;/STRONG&gt;","Files":2}]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is the code I'm following in tJavaRow to implement it:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;output_row.Document = input_row.Document+" "+context.date;&lt;BR /&gt;output_row.Files = Integer.parseInt(input_row.Files);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, I've attached a screenshot, where I need that value in instead of null in my JSON output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can Anyone help me with this?&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 07:30:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-include-the-assigned-value-in-context-variables-to/m-p/2376382#M144409</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T07:30:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to include the assigned value in context variables to tJavaRow</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-include-the-assigned-value-in-context-variables-to/m-p/2376383#M144410</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Did the tJavaRow receive a row (shown in the metrics of the flow to tJavaRow) ?&lt;/P&gt;
&lt;P&gt;Do you want to retrieve the current date when you run the job and your context variable in date format?&lt;/P&gt;
&lt;P&gt;Best regards&lt;/P&gt;
&lt;P&gt;Sabrina&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Oct 2018 04:54:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-include-the-assigned-value-in-context-variables-to/m-p/2376383#M144410</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-22T04:54:52Z</dc:date>
    </item>
  </channel>
</rss>

