<?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: Problem with variables and dynamic API query in Pipelines</title>
    <link>https://community.fabric.microsoft.com/t5/Pipelines/Problem-with-variables-and-dynamic-API-query/m-p/3713993#M1925</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="350131" data-lia-user-login="JayJay11" class="lia-mention lia-mention-user"&gt;JayJay11&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;Glad to know that your query got resolved. Please continue using Fabric Community for your further queries.&lt;/P&gt;</description>
    <pubDate>Wed, 21 Feb 2024 10:23:49 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-02-21T10:23:49Z</dc:date>
    <item>
      <title>Problem with variables and dynamic API query</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Problem-with-variables-and-dynamic-API-query/m-p/3713427#M1915</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so I am trying to use OData with a specific URL to retrieve data from SAP HANA. The URL string that I want to send looks as the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;$select=&lt;/STRONG&gt;CompanyCode,AccountingDocument,Ledger,GLRecordType,ControllingArea,ChartOfAccounts,GLAccount,BusinessTransactionType,CostCenter,ProfitCenter,FunctionalArea,Segment,PartnerCompany,GlobalCurrency,AmountInGlobalCurrency,BaseUnit,Quantity,DebitCreditCode,FiscalPeriod,FiscalYearVariant,FiscalYearPeriod,PostingDate,DocumentDate,AccountingDocumentType,PostingKey,OriginObjectType,GLAccountType,DocumentItemText,Product,Supplier,Customer,OffsettingAccount,WBSElementInternalID,ProjectInternalID&amp;amp;&lt;STRONG&gt;$filter=&lt;/STRONG&gt;PostingDate gt datetime'2024-01-31T00:00:00'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I put this static string in the query box in the copy action, everything works fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I want to make the filter argument (datetime) dynamic using a variable. To generate the current datetime, I use the activity Set variable and use the following expression:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;@formatDateTime(utcnow(), 'yyyy-MM-ddTHH:mm:ss')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The first problem is, that when I run the pipeline and inspect the variable, it is returned as the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
	"name": "vDateFrom",
	"value": "2024-02-21T07:11:39Z"
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So the pipeline adds the "Z" at the end, although I clearly stated the shortable format as the desired output. Is this a bug?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Further, how can I use then this variable as the query? So far I am only getting errors. Even when I just try the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;concat('$select=CompanyCode,AccountingDocument,Ledger,GLRecordType,ControllingArea,ChartOfAccounts,GLAccount,BusinessTransactionType,CostCenter,ProfitCenter,FunctionalArea,Segment,PartnerCompany,GlobalCurrency,AmountInGlobalCurrency,BaseUnit,Quantity,DebitCreditCode,FiscalPeriod,FiscalYearVariant,FiscalYearPeriod,PostingDate,DocumentDate,AccountingDocumentType,PostingKey,OriginObjectType,GLAccountType,DocumentItemText,Product,Supplier,Customer,OffsettingAccount,WBSElementInternalID,ProjectInternalID&amp;amp;$filter=PostingDate gt datetime', '2024-01-31T00:00:00')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Only when I just put the string as stated above (without any functions) the data preview works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I misunderstanding here?&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2024 07:21:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Problem-with-variables-and-dynamic-API-query/m-p/3713427#M1915</guid>
      <dc:creator>JayJay11</dc:creator>
      <dc:date>2024-02-21T07:21:14Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with variables and dynamic API query</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Problem-with-variables-and-dynamic-API-query/m-p/3713465#M1916</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="350131" data-lia-user-login="JayJay11" class="lia-mention lia-mention-user"&gt;JayJay11&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;Thanks for using Fabric Community.&lt;BR /&gt;&lt;BR /&gt;Can you please try this -&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;@formatDateTime(utcnow(),'yyyy-MM-ddTHH:mm:ss zzz')&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV id="mat-dialog-title-127" class=""&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;Output
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;
&lt;DIV class="" role="text" aria-label=""&gt;{ "name": "Change Date format", "value": "&lt;STRONG&gt;2024-01-31T22:26:37 +00:00" }&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;Hope this is helpful. Please let me know incase of further queries.&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 21 Feb 2024 07:34:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Problem-with-variables-and-dynamic-API-query/m-p/3713465#M1916</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-02-21T07:34:44Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with variables and dynamic API query</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Problem-with-variables-and-dynamic-API-query/m-p/3713523#M1917</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;thank you for supporting. Though I am not sure how this is solving it, as this is again not the desired format. But let's nevermind that for a moment, I have a general problem understanding how variables work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I try the following:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So with the first activity, I create a string. That string I store in a variable, which I then want to use in my copy action as following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This pipeline should only run about 20 seconds, which is the case if I put the string directly to the Query without using a variable. However, when I use a variable, the pipeline runs much much longer, I had to stop it after 15 minutes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I doing wrong here?&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2024 08:03:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Problem-with-variables-and-dynamic-API-query/m-p/3713523#M1917</guid>
      <dc:creator>JayJay11</dc:creator>
      <dc:date>2024-02-21T08:03:30Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with variables and dynamic API query</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Problem-with-variables-and-dynamic-API-query/m-p/3713733#M1918</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="350131" data-lia-user-login="JayJay11" class="lia-mention lia-mention-user"&gt;JayJay11&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;I have tried both the ways using Set Variable and normal but didn't find any difference in exceution.&lt;BR /&gt;&lt;BR /&gt;With Set Variable:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Without Set Variable:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Inorder to debug please check the output of Set Variable -&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Can you please check your syntax?&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Correct Syntax:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;@concat('sales__1_test','1')&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2024 09:25:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Problem-with-variables-and-dynamic-API-query/m-p/3713733#M1918</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-02-21T09:25:05Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with variables and dynamic API query</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Problem-with-variables-and-dynamic-API-query/m-p/3713896#M1921</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;thank you - actually adding the "@" solved it. Great!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now only the problem with the datetime. How can I get exactly the format "2024-02-21T00:00:00" as a string starting from the function utcnow()? The pipeline always adds this "Z" at the end, why?&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2024 09:53:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Problem-with-variables-and-dynamic-API-query/m-p/3713896#M1921</guid>
      <dc:creator>JayJay11</dc:creator>
      <dc:date>2024-02-21T09:53:57Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with variables and dynamic API query</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Problem-with-variables-and-dynamic-API-query/m-p/3713919#M1922</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="350131" data-lia-user-login="JayJay11" class="lia-mention lia-mention-user"&gt;JayJay11&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;@formatDateTime(utcnow(),'yyyy-MM-ddTHH:mm:ss zzz')&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Can you check this format and let me know if that works?&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2024 10:20:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Problem-with-variables-and-dynamic-API-query/m-p/3713919#M1922</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-02-21T10:20:38Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with variables and dynamic API query</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Problem-with-variables-and-dynamic-API-query/m-p/3713979#M1924</link>
      <description>&lt;P&gt;Again, this is not producing what I want, as it is adding things at the end of the string.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I solved it like that:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;@concat('&amp;amp;$filter=PostingDate gt datetime''',substring(variables('vReferenceDateTime'), 0, 10), 'T00:00:00''')&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 21 Feb 2024 10:19:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Problem-with-variables-and-dynamic-API-query/m-p/3713979#M1924</guid>
      <dc:creator>JayJay11</dc:creator>
      <dc:date>2024-02-21T10:19:04Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with variables and dynamic API query</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Problem-with-variables-and-dynamic-API-query/m-p/3713993#M1925</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="350131" data-lia-user-login="JayJay11" class="lia-mention lia-mention-user"&gt;JayJay11&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;Glad to know that your query got resolved. Please continue using Fabric Community for your further queries.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2024 10:23:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Problem-with-variables-and-dynamic-API-query/m-p/3713993#M1925</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-02-21T10:23:49Z</dc:date>
    </item>
  </channel>
</rss>

