<?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: Cant pass a global variable to tRest Http Body in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Cant-pass-a-global-variable-to-tRest-Http-Body/m-p/2347465#M114718</link>
    <description>&lt;P&gt;i tried your suggestion but i still get the same error.&lt;/P&gt;&lt;P&gt;Yes i need the [] around the session id value because im working with an API that requires the [] in the params value .&lt;/P&gt;</description>
    <pubDate>Mon, 05 Jun 2023 07:30:26 GMT</pubDate>
    <dc:creator>IliasTahri</dc:creator>
    <dc:date>2023-06-05T07:30:26Z</dc:date>
    <item>
      <title>Cant pass a global variable to tRest Http Body</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Cant-pass-a-global-variable-to-tRest-Http-Body/m-p/2347463#M114716</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000htcRHAAY.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/133373iDBEED1F00DE4AA22/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000htcRHAAY.png" alt="0695b00000htcRHAAY.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I'm trying to use a global variable that i defined before as parameter of &lt;/P&gt;&lt;P&gt;POST&lt;/P&gt; http &lt;P&gt;body in the tRest component as follows :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000htcrkAAA.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/134383i4B31EE426C7F3222/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000htcrkAAA.png" alt="0695b00000htcrkAAA.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but im getting the " unable to decode malformed json "&lt;/P&gt;&lt;P&gt;Do you know a solution ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 21:44:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Cant-pass-a-global-variable-to-tRest-Http-Body/m-p/2347463#M114716</guid>
      <dc:creator>IliasTahri</dc:creator>
      <dc:date>2024-11-15T21:44:10Z</dc:date>
    </item>
    <item>
      <title>Re: Cant pass a global variable to tRest Http Body</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Cant-pass-a-global-variable-to-tRest-Http-Body/m-p/2347464#M114717</link>
      <description>&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;the expression syntax is not right, to use a global variable in a string, the expression looks like:&lt;/P&gt;&lt;P&gt;"...params\":["+(String)globalMap.get("session_id")+"]}"&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;// BTW,  you need [] around the session id value in your case?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please try again and let me know if it works. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shong&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2023 02:19:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Cant-pass-a-global-variable-to-tRest-Http-Body/m-p/2347464#M114717</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-06-05T02:19:08Z</dc:date>
    </item>
    <item>
      <title>Re: Cant pass a global variable to tRest Http Body</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Cant-pass-a-global-variable-to-tRest-Http-Body/m-p/2347465#M114718</link>
      <description>&lt;P&gt;i tried your suggestion but i still get the same error.&lt;/P&gt;&lt;P&gt;Yes i need the [] around the session id value because im working with an API that requires the [] in the params value .&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2023 07:30:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Cant-pass-a-global-variable-to-tRest-Http-Body/m-p/2347465#M114718</guid>
      <dc:creator>IliasTahri</dc:creator>
      <dc:date>2023-06-05T07:30:26Z</dc:date>
    </item>
    <item>
      <title>Re: Cant pass a global variable to tRest Http Body</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Cant-pass-a-global-variable-to-tRest-Http-Body/m-p/2347466#M114719</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Try to print the value of global variable before it is used to check if it has the right value.  eg:&lt;/P&gt;&lt;P&gt;tBufferOutput--main--tSetGlobalVar&lt;/P&gt;&lt;P&gt;|onsubjobok&lt;/P&gt;&lt;P&gt;tJava&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;on tJava:&lt;/P&gt;&lt;P&gt;System.out.println((String)globalMap.get("session_id"));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In addition, have a try to set a fixed session id in the body string to test if JSON format in body is fine. &lt;/P&gt;&lt;P&gt;"...params\":[your_session_id_value]}"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2023 08:28:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Cant-pass-a-global-variable-to-tRest-Http-Body/m-p/2347466#M114719</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-06-05T08:28:28Z</dc:date>
    </item>
    <item>
      <title>Re: Cant pass a global variable to tRest Http Body</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Cant-pass-a-global-variable-to-tRest-Http-Body/m-p/2347467#M114720</link>
      <description>&lt;P&gt;that is not the issue.. the problem is that the error " unable to decode malformed json " so even if the session_id value is incorrect i should get a response other than the error above&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i've also tried to hard code the session key to test the json format and it works fine ..&lt;/P&gt;&lt;P&gt;I'm starting to think its not possible to use a global variable in http body with json format &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2023 09:15:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Cant-pass-a-global-variable-to-tRest-Http-Body/m-p/2347467#M114720</guid>
      <dc:creator>IliasTahri</dc:creator>
      <dc:date>2023-06-05T09:15:42Z</dc:date>
    </item>
  </channel>
</rss>

