<?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: WITH CONNECTION statement - BODY with Double quote in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/WITH-CONNECTION-statement-BODY-with-Double-quote/m-p/2041026#M18154</link>
    <description>&lt;P&gt;Is your source an Azure Cosmos DB - it sure looks like it with the two functions&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;DateTimePart()&lt;/STRONG&gt; and&amp;nbsp; &lt;STRONG&gt;TimestampToDateTime()&lt;/STRONG&gt;....&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;According to Microsofts documentation the first parameter of the DateTimePart needs to be in double quotes - not in single quotes like you have done. So the first I would try using two double quotes like this:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;{ "query": "SELECT * FROM AppLogs f WHERE (DateTimePart(&lt;STRONG&gt;""&lt;/STRONG&gt;yyyy&lt;STRONG&gt;""&lt;/STRONG&gt;, TimestampToDateTime(f._ts * 1000)) = 2023) AND f.RequestPath in ('/payments/post-sales','/payments/pre-sales','/payments/refunds','/payments','/Payments')"}&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 22 Feb 2023 15:51:47 GMT</pubDate>
    <dc:creator>petter</dc:creator>
    <dc:date>2023-02-22T15:51:47Z</dc:date>
    <item>
      <title>WITH CONNECTION statement - BODY with Double quote</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/WITH-CONNECTION-statement-BODY-with-Double-quote/m-p/1237635#M6585</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to POST a REST connection with a Body.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While there is no issue when it is a static BODY (in the connection edition), I can't do it right now in the BODY parameter of the "WITH CONNECTION" statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would you know if there is any escape character or any other solution?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't replace double quote by nothing nor by single quote as per the API requirements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the exemple:&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;Let vBody = '{["ids":[10001,10002]]}';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load &lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;FROM JSON (wrap off) "root" PK "__KEY_root"&lt;/P&gt;&lt;P&gt;WITH CONNECTION(URL "$(vUrl)",&lt;/P&gt;&lt;P&gt;HEADER "$(vHeaderName)" "$(vHeaderParameter",&lt;/P&gt;&lt;P&gt;BODY "$(vBody)");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance for your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Mar 2017 19:02:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/WITH-CONNECTION-statement-BODY-with-Double-quote/m-p/1237635#M6585</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-03-19T19:02:43Z</dc:date>
    </item>
    <item>
      <title>Re: WITH CONNECTION statement - BODY with Double quote</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/WITH-CONNECTION-statement-BODY-with-Double-quote/m-p/1237636#M6586</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can simply double your quotes and Qlik will make sure to send it correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vBody = '{[""ids"":[10001,10002]]}';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So doubling your double quotes will do the trick...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Mar 2017 23:42:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/WITH-CONNECTION-statement-BODY-with-Double-quote/m-p/1237636#M6586</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2017-03-19T23:42:20Z</dc:date>
    </item>
    <item>
      <title>Re: WITH CONNECTION statement - BODY with Double quote</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/WITH-CONNECTION-statement-BODY-with-Double-quote/m-p/2025708#M17934</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/41481"&gt;@petter&lt;/a&gt;&amp;nbsp;I'm trying to do something very similar but must be missing something.&amp;nbsp; I have this as my body in the connection.&lt;/P&gt;
&lt;P&gt;{ "query": "SELECT * FROM AppLogs f WHERE (DateTimePart('yyyy', TimestampToDateTime(f._ts * 1000)) = 2023) AND f.RequestPath in ('/payments/post-sales','/payments/pre-sales','/payments/refunds','/payments','/Payments')"}&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="carlcimino_0-1673635169558.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/98033i118CA50F321A5DA0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="carlcimino_0-1673635169558.png" alt="carlcimino_0-1673635169558.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;i tried to do this:&lt;/P&gt;
&lt;P&gt;let vBody = '{ "query": "SELECT * FROM AppLogs f WHERE (DateTimePart('yyyy', TimestampToDateTime(f._ts * 1000)) = 2023) AND f.RequestPath in ('/payments/post-sales','/payments/pre-sales','/payments/refunds','/payments','/Payments')"}';&lt;/P&gt;
&lt;P&gt;I then put the BODY and variable in the with connection&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;FROM&lt;/SPAN&gt;&lt;SPAN&gt; JSON &lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;wrap on&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt; &lt;SPAN&gt;"root"&lt;/SPAN&gt;&lt;SPAN&gt; PK &lt;/SPAN&gt;&lt;SPAN&gt;"__KEY_root"&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;WITH&lt;/SPAN&gt;&lt;SPAN&gt; CONNECTION&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;url &lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;$(v_EnvironmentURL)&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;HTTPHEADER &lt;/SPAN&gt;&lt;SPAN&gt;"Authorization"&lt;/SPAN&gt; &lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;$(vSessionId)&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;HTTPHEADER &lt;/SPAN&gt;&lt;SPAN&gt;"x-ms-date"&lt;/SPAN&gt; &lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;$(vMS_Date)&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;HTTPHEADER &lt;/SPAN&gt;&lt;SPAN&gt;"x-ms-version"&lt;/SPAN&gt; &lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;$(vMS_Version)&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;HTTPHEADER &lt;/SPAN&gt;&lt;SPAN&gt;"x-ms-max-item-count"&lt;/SPAN&gt; &lt;SPAN&gt;"1000",&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;BODY &lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;$(vBody)&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;when I go to load the data I get this error message.&amp;nbsp; Any ideas/suggestions would be much appreciated!&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="carlcimino_2-1673635506158.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/98039iD163A65B51E389AB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="carlcimino_2-1673635506158.png" alt="carlcimino_2-1673635506158.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2023 18:45:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/WITH-CONNECTION-statement-BODY-with-Double-quote/m-p/2025708#M17934</guid>
      <dc:creator>carlcimino</dc:creator>
      <dc:date>2023-01-13T18:45:47Z</dc:date>
    </item>
    <item>
      <title>Re: WITH CONNECTION statement - BODY with Double quote</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/WITH-CONNECTION-statement-BODY-with-Double-quote/m-p/2041026#M18154</link>
      <description>&lt;P&gt;Is your source an Azure Cosmos DB - it sure looks like it with the two functions&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;DateTimePart()&lt;/STRONG&gt; and&amp;nbsp; &lt;STRONG&gt;TimestampToDateTime()&lt;/STRONG&gt;....&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;According to Microsofts documentation the first parameter of the DateTimePart needs to be in double quotes - not in single quotes like you have done. So the first I would try using two double quotes like this:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;{ "query": "SELECT * FROM AppLogs f WHERE (DateTimePart(&lt;STRONG&gt;""&lt;/STRONG&gt;yyyy&lt;STRONG&gt;""&lt;/STRONG&gt;, TimestampToDateTime(f._ts * 1000)) = 2023) AND f.RequestPath in ('/payments/post-sales','/payments/pre-sales','/payments/refunds','/payments','/Payments')"}&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2023 15:51:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/WITH-CONNECTION-statement-BODY-with-Double-quote/m-p/2041026#M18154</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2023-02-22T15:51:47Z</dc:date>
    </item>
    <item>
      <title>Re: WITH CONNECTION statement - BODY with Double quote</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/WITH-CONNECTION-statement-BODY-with-Double-quote/m-p/2041544#M18163</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/41481"&gt;@petter&lt;/a&gt;&amp;nbsp;Yes you're absolutely correct.&amp;nbsp; This is Azure Cosmos DB. I tried to do as you suggested and it still gives the unexpected token/operator error.&amp;nbsp; The script editor looks like it doesn't like the '/ in the request paths part of the query.&amp;nbsp; In pPstman it works fine without the double quotes and the request paths the way I have them.&lt;/P&gt;
&lt;P&gt;let vBody = '{"query": "SELECT * FROM AppLogs f WHERE (DateTimePart(""yyyy"", TimestampToDateTime(f._ts * 1000)) = 2023) AND f.RequestPath in ('/payments/post-sales','/payments/pre-sales','/payments/refunds','/payments','/Payments')"}';&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="carlcimino_0-1677167340139.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/101225iBFB059EA6CDF0697/image-size/medium?v=v2&amp;amp;px=400" role="button" title="carlcimino_0-1677167340139.png" alt="carlcimino_0-1677167340139.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="carlcimino_1-1677167390810.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/101226i589A91273389DB60/image-size/medium?v=v2&amp;amp;px=400" role="button" title="carlcimino_1-1677167390810.png" alt="carlcimino_1-1677167390810.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="carlcimino_2-1677167601954.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/101227iDB700F901E33AF24/image-size/medium?v=v2&amp;amp;px=400" role="button" title="carlcimino_2-1677167601954.png" alt="carlcimino_2-1677167601954.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2023 15:54:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/WITH-CONNECTION-statement-BODY-with-Double-quote/m-p/2041544#M18163</guid>
      <dc:creator>carlcimino</dc:creator>
      <dc:date>2023-02-23T15:54:38Z</dc:date>
    </item>
    <item>
      <title>Re: WITH CONNECTION statement - BODY with Double quote</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/WITH-CONNECTION-statement-BODY-with-Double-quote/m-p/2041560#M18164</link>
      <description>&lt;P&gt;Then I would have tried to replace each of your single-quotes either by double single-quotes or double double-quotes. It is quick to try and it might do the trick...&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2023 16:25:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/WITH-CONNECTION-statement-BODY-with-Double-quote/m-p/2041560#M18164</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2023-02-23T16:25:02Z</dc:date>
    </item>
    <item>
      <title>Re: WITH CONNECTION statement - BODY with Double quote</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/WITH-CONNECTION-statement-BODY-with-Double-quote/m-p/2041690#M18167</link>
      <description>&lt;P&gt;This is very frustrating.&amp;nbsp; Tried both ways.&amp;nbsp; Looks like something next to the SELECT or query part.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Double double Quotes.&lt;BR /&gt;&lt;BR /&gt;let vBody = '{"query": "SELECT * FROM AppLogs f WHERE (DateTimePart(""yyyy"", TimestampToDateTime(f._ts * 1000)) = 2023) AND f.RequestPath in (""/payments/post-sales"",""/payments/pre-sales"",""/payments/refunds"",""/payments"",""/Payments"")"}';&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="carlcimino_0-1677189327564.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/101258iD0E60B80A7FC8DF1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="carlcimino_0-1677189327564.png" alt="carlcimino_0-1677189327564.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="carlcimino_1-1677189365965.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/101259i9D6A4F56E54F4EF6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="carlcimino_1-1677189365965.png" alt="carlcimino_1-1677189365965.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Double Single quotes&lt;BR /&gt;&lt;/STRONG&gt;&lt;BR /&gt;let vBody = '{"query": "SELECT * FROM AppLogs f WHERE (DateTimePart(''yyyy'', TimestampToDateTime(f._ts * 1000)) = 2023) AND f.RequestPath in (''/payments/post-sales'',''/payments/pre-sales'',''/payments/refunds'',''/payments'',''/Payments'')"}';&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="carlcimino_2-1677189939627.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/101260iF384A7DE4EA4B1B7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="carlcimino_2-1677189939627.png" alt="carlcimino_2-1677189939627.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2023 22:07:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/WITH-CONNECTION-statement-BODY-with-Double-quote/m-p/2041690#M18167</guid>
      <dc:creator>carlcimino</dc:creator>
      <dc:date>2023-02-23T22:07:24Z</dc:date>
    </item>
  </channel>
</rss>

