<?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 Iterate tRest API call with dynamic body in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Iterate-tRest-API-call-with-dynamic-body/m-p/2442968#M140531</link>
    <description>&lt;P data-sourcepos="3:1-3:16"&gt;Hi everyone,&amp;nbsp;I'm having trouble with a task and need some help.&lt;/P&gt;
&lt;P data-sourcepos="7:1-7:18"&gt;I have two tables:&lt;/P&gt;
&lt;UL data-sourcepos="9:1-11:0"&gt;
&lt;LI data-sourcepos="9:1-9:57"&gt;One with all the products in a CRM - (ImportedProducts)&lt;/LI&gt;
&lt;LI data-sourcepos="10:1-11:0"&gt;One with all the products and prices from an ERP - (PricebookView)&lt;/LI&gt;
&lt;/UL&gt;
&lt;P data-sourcepos="12:1-12:193"&gt;I want to update the prices of all the products in the CRM (ImportedProducts) based on the prices in PricebookView. To do this, I need to make multiple API calls with the following structure:&lt;/P&gt;
&lt;P data-sourcepos="14:1-14:133"&gt;&lt;STRONG&gt;URL:&lt;/STRONG&gt; &lt;A href="http://www.url.com/products/" target="_blank"&gt;www.url.com/products/&lt;/A&gt; &lt;EM&gt;{productid}&lt;/EM&gt; where &lt;EM&gt;{productid}&lt;/EM&gt; is dynamic and represents the ID I have in ImportedProducts&lt;/P&gt;
&lt;P data-sourcepos="16:1-16:47"&gt;&lt;STRONG&gt;BODY &lt;/STRONG&gt;(to update the subtotal, for example):&lt;/P&gt;
&lt;DIV class="code-block ng-star-inserted"&gt;
&lt;DIV class="code-block-decoration header gmat-subtitle-1 ng-star-inserted"&gt;&lt;SPAN&gt;JSON&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="code-block-internal-container"&gt;
&lt;PRE&gt;&lt;CODE class="code-container" role="text" data-test-id="code-content" data-sourcepos="18:1-22:1"&gt;{
  &lt;SPAN class="hljs-attr"&gt;"subtotal"&lt;/SPAN&gt;: &lt;EM&gt;{price}&lt;/EM&gt;
}&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P data-sourcepos="24:1-24:102"&gt;where &lt;EM&gt;{price}&lt;/EM&gt; is the price for the &lt;EM&gt;{productid}&lt;/EM&gt; in the URL. Of course, there are many prices to update.&lt;/P&gt;
&lt;P data-sourcepos="26:1-26:135"&gt;I've implemented the basic job functionality, but I'm stuck on how to pass dynamic values to the URL and body. Any suggestions? Thanks!&lt;/P&gt;
&lt;P data-sourcepos="26:1-26:135"&gt;Here the actual job has an error (Syntax error on token "") }"", delete this token. But I think this is not only a syntax error but a structure error.&lt;/P&gt;
&lt;P data-sourcepos="26:1-26:135"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot_94.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/164377iDE49FBF23B188E35/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot_94.png" alt="Screenshot_94.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P data-sourcepos="26:1-26:135"&gt;&lt;LI-PRODUCT title="Talend Studio" id="qlik_TalendStudio"&gt;&lt;/LI-PRODUCT&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 19 Apr 2024 13:16:38 GMT</pubDate>
    <dc:creator>dura45</dc:creator>
    <dc:date>2024-04-19T13:16:38Z</dc:date>
    <item>
      <title>Iterate tRest API call with dynamic body</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Iterate-tRest-API-call-with-dynamic-body/m-p/2442968#M140531</link>
      <description>&lt;P data-sourcepos="3:1-3:16"&gt;Hi everyone,&amp;nbsp;I'm having trouble with a task and need some help.&lt;/P&gt;
&lt;P data-sourcepos="7:1-7:18"&gt;I have two tables:&lt;/P&gt;
&lt;UL data-sourcepos="9:1-11:0"&gt;
&lt;LI data-sourcepos="9:1-9:57"&gt;One with all the products in a CRM - (ImportedProducts)&lt;/LI&gt;
&lt;LI data-sourcepos="10:1-11:0"&gt;One with all the products and prices from an ERP - (PricebookView)&lt;/LI&gt;
&lt;/UL&gt;
&lt;P data-sourcepos="12:1-12:193"&gt;I want to update the prices of all the products in the CRM (ImportedProducts) based on the prices in PricebookView. To do this, I need to make multiple API calls with the following structure:&lt;/P&gt;
&lt;P data-sourcepos="14:1-14:133"&gt;&lt;STRONG&gt;URL:&lt;/STRONG&gt; &lt;A href="http://www.url.com/products/" target="_blank"&gt;www.url.com/products/&lt;/A&gt; &lt;EM&gt;{productid}&lt;/EM&gt; where &lt;EM&gt;{productid}&lt;/EM&gt; is dynamic and represents the ID I have in ImportedProducts&lt;/P&gt;
&lt;P data-sourcepos="16:1-16:47"&gt;&lt;STRONG&gt;BODY &lt;/STRONG&gt;(to update the subtotal, for example):&lt;/P&gt;
&lt;DIV class="code-block ng-star-inserted"&gt;
&lt;DIV class="code-block-decoration header gmat-subtitle-1 ng-star-inserted"&gt;&lt;SPAN&gt;JSON&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="code-block-internal-container"&gt;
&lt;PRE&gt;&lt;CODE class="code-container" role="text" data-test-id="code-content" data-sourcepos="18:1-22:1"&gt;{
  &lt;SPAN class="hljs-attr"&gt;"subtotal"&lt;/SPAN&gt;: &lt;EM&gt;{price}&lt;/EM&gt;
}&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P data-sourcepos="24:1-24:102"&gt;where &lt;EM&gt;{price}&lt;/EM&gt; is the price for the &lt;EM&gt;{productid}&lt;/EM&gt; in the URL. Of course, there are many prices to update.&lt;/P&gt;
&lt;P data-sourcepos="26:1-26:135"&gt;I've implemented the basic job functionality, but I'm stuck on how to pass dynamic values to the URL and body. Any suggestions? Thanks!&lt;/P&gt;
&lt;P data-sourcepos="26:1-26:135"&gt;Here the actual job has an error (Syntax error on token "") }"", delete this token. But I think this is not only a syntax error but a structure error.&lt;/P&gt;
&lt;P data-sourcepos="26:1-26:135"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot_94.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/164377iDE49FBF23B188E35/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot_94.png" alt="Screenshot_94.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P data-sourcepos="26:1-26:135"&gt;&lt;LI-PRODUCT title="Talend Studio" id="qlik_TalendStudio"&gt;&lt;/LI-PRODUCT&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Apr 2024 13:16:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Iterate-tRest-API-call-with-dynamic-body/m-p/2442968#M140531</guid>
      <dc:creator>dura45</dc:creator>
      <dc:date>2024-04-19T13:16:38Z</dc:date>
    </item>
    <item>
      <title>Re: Iterate tRest API call with dynamic body</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Iterate-tRest-API-call-with-dynamic-body/m-p/2443431#M140533</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;You need to escape the double quotes in the body string, eg:&lt;/P&gt;
&lt;P&gt;"{\\"key\\":value}"&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Apr 2024 10:03:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Iterate-tRest-API-call-with-dynamic-body/m-p/2443431#M140533</guid>
      <dc:creator>Shicong_Hong</dc:creator>
      <dc:date>2024-04-22T10:03:30Z</dc:date>
    </item>
  </channel>
</rss>

