<?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: Dynamically Change date range of web source (api link) in Power Query</title>
    <link>https://community.fabric.microsoft.com/t5/Power-Query/Dynamically-Change-date-range-of-web-source-api-link/m-p/2916328#M92002</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="474512" data-lia-user-login="AI14" class="lia-mention lia-mention-user"&gt;AI14&lt;/a&gt;&amp;nbsp;You want a single day's data? You can replace those dates with this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;= Date.ToText ( 
    Date.From ( 
        DateTime.LocalNow ( ) 
    ), 
    [Format = "yyyy-MM-dd", Culture = "en-US"] 
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 19 Nov 2022 13:14:50 GMT</pubDate>
    <dc:creator>AntrikshSharma</dc:creator>
    <dc:date>2022-11-19T13:14:50Z</dc:date>
    <item>
      <title>Dynamically Change date range of web source (api link)</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Dynamically-Change-date-range-of-web-source-api-link/m-p/2916311#M92001</link>
      <description>&lt;P&gt;Im new to powerquery and have made a connection to a site using APi key.&lt;/P&gt;&lt;P&gt;im trying to avoid going into the source every day to look at yesterdays data or any previous day.&lt;/P&gt;&lt;P&gt;how can i do this dynamically where i choose e.g. 16/11/2022 and it populates both my from and to dates in my source&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Json.Document(Web.Contents("&lt;A href="https://www.findmyshift.co.uk/apixxxxxxxxx/1.4/reports/hours" target="_blank" rel="noopener"&gt;w.findmyshift.co.uk/apixxxxxxxxx/1.4/reports/hours&lt;/A&gt;?" &amp;amp; "apiKey=&amp;amp;" &amp;amp; "teamId=y22t0l5t4i&amp;amp;" &amp;amp; &lt;STRONG&gt;"from=2022-11-16&amp;amp;" &amp;amp; "to=2022-11-16&amp;amp;"&lt;/STRONG&gt; &amp;amp; "timesheetData=yes&amp;amp;" &amp;amp; "additional-columns=staff.jobtitle&amp;amp;" &amp;amp; "additional-columns=staff.department"))&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 19 Nov 2022 12:57:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Dynamically-Change-date-range-of-web-source-api-link/m-p/2916311#M92001</guid>
      <dc:creator>AI14</dc:creator>
      <dc:date>2022-11-19T12:57:04Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically Change date range of web source (api link)</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Dynamically-Change-date-range-of-web-source-api-link/m-p/2916328#M92002</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="474512" data-lia-user-login="AI14" class="lia-mention lia-mention-user"&gt;AI14&lt;/a&gt;&amp;nbsp;You want a single day's data? You can replace those dates with this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;= Date.ToText ( 
    Date.From ( 
        DateTime.LocalNow ( ) 
    ), 
    [Format = "yyyy-MM-dd", Culture = "en-US"] 
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 19 Nov 2022 13:14:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Dynamically-Change-date-range-of-web-source-api-link/m-p/2916328#M92002</guid>
      <dc:creator>AntrikshSharma</dc:creator>
      <dc:date>2022-11-19T13:14:50Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically Change date range of web source (api link)</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Dynamically-Change-date-range-of-web-source-api-link/m-p/2916393#M92009</link>
      <description>&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;could this also be done if i set it yesterday instead of today?&lt;/P&gt;&lt;P&gt;also is it possible to have it linked to a cell where dat is entered?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 19 Nov 2022 14:31:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Dynamically-Change-date-range-of-web-source-api-link/m-p/2916393#M92009</guid>
      <dc:creator>AI14</dc:creator>
      <dc:date>2022-11-19T14:31:31Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically Change date range of web source (api link)</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Dynamically-Change-date-range-of-web-source-api-link/m-p/2916418#M92010</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="474512" data-lia-user-login="AI14" class="lia-mention lia-mention-user"&gt;AI14&lt;/a&gt;&amp;nbsp;Are you using Excel for this? Then you can create a new query from a particular cell and then reference that query in the above code.&lt;/P&gt;</description>
      <pubDate>Sat, 19 Nov 2022 15:12:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Dynamically-Change-date-range-of-web-source-api-link/m-p/2916418#M92010</guid>
      <dc:creator>AntrikshSharma</dc:creator>
      <dc:date>2022-11-19T15:12:33Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically Change date range of web source (api link)</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Dynamically-Change-date-range-of-web-source-api-link/m-p/2916422#M92011</link>
      <description>&lt;P&gt;yes i am, sorry i didnt mention it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 19 Nov 2022 15:15:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Dynamically-Change-date-range-of-web-source-api-link/m-p/2916422#M92011</guid>
      <dc:creator>AI14</dc:creator>
      <dc:date>2022-11-19T15:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically Change date range of web source (api link)</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Dynamically-Change-date-range-of-web-source-api-link/m-p/2916423#M92012</link>
      <description>&lt;P&gt;would the code stay the same or do i need to reference the sheet, cell number?&lt;/P&gt;</description>
      <pubDate>Sat, 19 Nov 2022 15:16:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Dynamically-Change-date-range-of-web-source-api-link/m-p/2916423#M92012</guid>
      <dc:creator>AI14</dc:creator>
      <dc:date>2022-11-19T15:16:35Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically Change date range of web source (api link)</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Dynamically-Change-date-range-of-web-source-api-link/m-p/2916449#M92014</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="474512" data-lia-user-login="AI14" class="lia-mention lia-mention-user"&gt;AI14&lt;/a&gt;&amp;nbsp;Create a table in Excel with name DateParameter&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;And then you can load the table into PQ, the code will look like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;let
    Source = 
        Excel.CurrentWorkbook(){[ Name = "DateParameter" ]}[Content],
    ChangedType = 
        Table.TransformColumnTypes ( Source, { { "Date", type datetime } } ),
    Date = 
        Date.ToText (
            Date.From ( ChangedType[Date]{0} ),
            [ Format = "yyyy-MM-dd", Culture = "en-US" ]
        )
in
    Date&lt;/LI-CODE&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;As you can see the the data type of quer is just scalar text value now you can use the name DateParameter in your original code.&lt;/P&gt;</description>
      <pubDate>Sat, 19 Nov 2022 15:46:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Dynamically-Change-date-range-of-web-source-api-link/m-p/2916449#M92014</guid>
      <dc:creator>AntrikshSharma</dc:creator>
      <dc:date>2022-11-19T15:46:56Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically Change date range of web source (api link)</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Dynamically-Change-date-range-of-web-source-api-link/m-p/2917128#M92043</link>
      <description>&lt;P&gt;ammazing and would this work for both from &amp;amp; to dates?&lt;/P&gt;</description>
      <pubDate>Sun, 20 Nov 2022 17:38:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Dynamically-Change-date-range-of-web-source-api-link/m-p/2917128#M92043</guid>
      <dc:creator>AI14</dc:creator>
      <dc:date>2022-11-20T17:38:00Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically Change date range of web source (api link)</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Dynamically-Change-date-range-of-web-source-api-link/m-p/2917183#M92045</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="474512" data-lia-user-login="AI14" class="lia-mention lia-mention-user"&gt;AI14&lt;/a&gt;&amp;nbsp;Did you try it?&lt;/P&gt;</description>
      <pubDate>Sun, 20 Nov 2022 19:03:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Dynamically-Change-date-range-of-web-source-api-link/m-p/2917183#M92045</guid>
      <dc:creator>AntrikshSharma</dc:creator>
      <dc:date>2022-11-20T19:03:58Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically Change date range of web source (api link)</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Dynamically-Change-date-range-of-web-source-api-link/m-p/2917232#M92049</link>
      <description>&lt;P&gt;Date Parameter works but how do i incoporate it in code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i tried to put it in like below and i tried how i usually had it "from=dateparameter&amp;amp;" etc.&lt;/P&gt;&lt;P&gt;none worked so far&lt;/P&gt;&lt;P&gt;= Json.Document(Web.Contents("&lt;A href="https://www.findmyshift.co.uk/api/1.4/reports/hours" target="_blank"&gt;https://www.findmyshift.co.uk/api/1.4/reports/hours&lt;/A&gt;?" &amp;amp; "apiKey=xxxxxx&amp;amp;" &amp;amp; "teamId=y22t0l5t4i&amp;amp;" &amp;amp; &lt;STRONG&gt;DateParameter &amp;amp; DateParameter&lt;/STRONG&gt; &amp;amp; "timesheetData=yes&amp;amp;" &amp;amp; "additional-columns=staff.jobtitle&amp;amp;" &amp;amp; "additional-columns=staff.department"))&lt;/P&gt;</description>
      <pubDate>Sun, 20 Nov 2022 20:35:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Dynamically-Change-date-range-of-web-source-api-link/m-p/2917232#M92049</guid>
      <dc:creator>AI14</dc:creator>
      <dc:date>2022-11-20T20:35:14Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically Change date range of web source (api link)</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Dynamically-Change-date-range-of-web-source-api-link/m-p/2917829#M92067</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="474512" data-lia-user-login="AI14" class="lia-mention lia-mention-user"&gt;AI14&lt;/a&gt;&amp;nbsp;You are missing "from" and "to" in your code! Check your question.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2022 07:04:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Dynamically-Change-date-range-of-web-source-api-link/m-p/2917829#M92067</guid>
      <dc:creator>AntrikshSharma</dc:creator>
      <dc:date>2022-11-21T07:04:41Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically Change date range of web source (api link)</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Dynamically-Change-date-range-of-web-source-api-link/m-p/2918266#M92087</link>
      <description>&lt;P&gt;I meant i done this also and still not pulling data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;usually date range is "form=2022-11-20&amp;amp;" "to=2022-11-20&amp;amp;"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;= Json.Document(Web.Contents("&lt;A href="https://www.findmyshift.co.uk/api/1.4/reports/hours" target="_blank" rel="noopener"&gt;https://www.findmyshift.co.uk/api/1.4/reports/hours&lt;/A&gt;?" &amp;amp; "apiKey=xxxxx&amp;amp;" &amp;amp; "teamId=y22t0l5t4i&amp;amp;" &amp;amp; from=DateParameter &amp;amp; to=DateParameter &amp;amp; "timesheetData=yes&amp;amp;" &amp;amp; "additional-columns=staff.jobtitle&amp;amp;" &amp;amp; "additional-columns=staff.department"))&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2022 09:37:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Dynamically-Change-date-range-of-web-source-api-link/m-p/2918266#M92087</guid>
      <dc:creator>AI14</dc:creator>
      <dc:date>2022-11-21T09:37:33Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically Change date range of web source (api link)</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Dynamically-Change-date-range-of-web-source-api-link/m-p/2918293#M92088</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="474512" data-lia-user-login="AI14" class="lia-mention lia-mention-user"&gt;AI14&lt;/a&gt;You need to include to and from in double quotes ....&amp;nbsp;&lt;SPAN&gt;&amp;amp; "from=" &amp;amp; DateParameter &amp;amp; "to=" &amp;amp; DateParameter &amp;amp;&amp;nbsp;....&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2022 09:42:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Dynamically-Change-date-range-of-web-source-api-link/m-p/2918293#M92088</guid>
      <dc:creator>AntrikshSharma</dc:creator>
      <dc:date>2022-11-21T09:42:17Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically Change date range of web source (api link)</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Dynamically-Change-date-range-of-web-source-api-link/m-p/2919015#M92104</link>
      <description>&lt;P&gt;= Json.Document(Web.Contents("&lt;A href="https://www.findmyshift.co.uk/api/1.4/reports/hours" target="_blank"&gt;https://www.findmyshift.co.uk/api/1.4/reports/hours&lt;/A&gt;?" &amp;amp; "apiKey=xxxxx&amp;amp;" &amp;amp; "teamId=y22t0l5t4i&amp;amp;" &amp;amp; "from=" &amp;amp; DateParameter &amp;amp; "to=" &amp;amp; DateParameter &amp;amp; "timesheetData=yes&amp;amp;" &amp;amp; "additional-columns=staff.jobtitle&amp;amp;" &amp;amp; "additional-columns=staff.department"))&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;not working, i think its because its creating additional line in code when the date should be after the from= and to=&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2022 14:33:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Dynamically-Change-date-range-of-web-source-api-link/m-p/2919015#M92104</guid>
      <dc:creator>AI14</dc:creator>
      <dc:date>2022-11-21T14:33:36Z</dc:date>
    </item>
  </channel>
</rss>

