<?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: API query return a range of selection in Power Query</title>
    <link>https://community.fabric.microsoft.com/t5/Power-Query/API-query-return-a-range-of-selection/m-p/1910131#M56502</link>
    <description>&lt;P&gt;Try taking out the Json.Document wrapper and just do Web.Contents to see what you get, and confirm/see the structure of the JSON.&amp;nbsp; Share screen shots of what you get back (if you can), if the issue is not obvious to you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Pat&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 19 Jun 2021 22:33:09 GMT</pubDate>
    <dc:creator>mahoneypat</dc:creator>
    <dc:date>2021-06-19T22:33:09Z</dc:date>
    <item>
      <title>API query return a range of selection</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/API-query-return-a-range-of-selection/m-p/1905051#M56381</link>
      <description>&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have an API key like below that is working, no problem.&amp;nbsp; However, how do I modify my query to return more than one &lt;FONT color="#FF0000"&gt;objectno&lt;/FONT&gt;?&amp;nbsp; For example &lt;FONT color="#FF0000"&gt;objectno &lt;FONT color="#000000"&gt;range that is&lt;/FONT&gt; 001 &lt;FONT color="#000000"&gt;to&lt;/FONT&gt; 020?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Json.Document(Web.Contents("&lt;A href="https://csv.business.tomtom.com/extern?account=AAAc&amp;amp;username=XXX&amp;amp;password=PPP&amp;amp;apikey=818c28e9-09ec-4a3d-b775-2101f4a750be&amp;amp;lang=en&amp;amp;action=showTripReportExtern&amp;amp;rangefrom_string=01/01/2021%2008:00:00&amp;amp;rangeto_string=15/06/2021%2023:59:00&amp;amp;" target="_blank" rel="noopener"&gt;https://csv.business.tomtom.com/extern?account=AAAc&amp;amp;username=XXX&amp;amp;password=PPP&amp;amp;apikey=818c28e9-09ec-4a3d-b775-2101f4a750be&amp;amp;lang=en&amp;amp;action=showTripReportExtern&amp;amp;rangefrom_string=01/01/2021%2008:00:00&amp;amp;rangeto_string=15/06/2021%2023:59:00&amp;amp;&lt;/A&gt;&lt;FONT color="#FF0000"&gt;objectno=001&lt;/FONT&gt;&amp;amp;outputformat=json"))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Raymond&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jun 2021 02:58:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/API-query-return-a-range-of-selection/m-p/1905051#M56381</guid>
      <dc:creator>clubspec</dc:creator>
      <dc:date>2021-06-17T02:58:16Z</dc:date>
    </item>
    <item>
      <title>Re: API query return a range of selection</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/API-query-return-a-range-of-selection/m-p/1907731#M56432</link>
      <description>&lt;P&gt;Here's one way to do it in the query editor.&amp;nbsp;&amp;nbsp;To see how it works, just create a blank query, open the Advanced Editor and replace the text there with the M code below.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;let
    Source = List.Numbers(1,19,1),
    #"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    #"Changed Type" = Table.TransformColumnTypes(#"Converted to Table",{{"Column1", type text}}),
    Custom1 = Table.TransformColumns(#"Changed Type", {"Column1", each Text.PadStart(_, 3, "0"), type text}),
    #"Added Custom" = Table.AddColumn(Custom1, "Custom", each Json.Document(Web.Contents("https://csv.business.tomtom.com/extern?account=AAAc&amp;amp;username=XXX&amp;amp;password=PPP&amp;amp;apikey=818c28e9-09ec-4...objectno=" &amp;amp; [Column1]&amp;amp;"outputformat=json")))
in
    #"Added Custom"&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Pat&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Jun 2021 01:57:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/API-query-return-a-range-of-selection/m-p/1907731#M56432</guid>
      <dc:creator>mahoneypat</dc:creator>
      <dc:date>2021-06-18T01:57:50Z</dc:date>
    </item>
    <item>
      <title>Re: API query return a range of selection</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/API-query-return-a-range-of-selection/m-p/1907859#M56439</link>
      <description>&lt;P&gt;Thanks Pat but it returns error:&lt;/P&gt;&lt;P&gt;"DataFormat.Error: We found extra characters at the end of JSON input.&lt;BR /&gt;Details:&lt;BR /&gt;Value=,&lt;BR /&gt;Position=4"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I query one &lt;FONT color="#FF0000"&gt;objectno&lt;/FONT&gt; at a time, it will return a list, from there I convert the list to a table.&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Fri, 18 Jun 2021 03:53:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/API-query-return-a-range-of-selection/m-p/1907859#M56439</guid>
      <dc:creator>clubspec</dc:creator>
      <dc:date>2021-06-18T03:53:21Z</dc:date>
    </item>
    <item>
      <title>Re: API query return a range of selection</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/API-query-return-a-range-of-selection/m-p/1910131#M56502</link>
      <description>&lt;P&gt;Try taking out the Json.Document wrapper and just do Web.Contents to see what you get, and confirm/see the structure of the JSON.&amp;nbsp; Share screen shots of what you get back (if you can), if the issue is not obvious to you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Pat&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 19 Jun 2021 22:33:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/API-query-return-a-range-of-selection/m-p/1910131#M56502</guid>
      <dc:creator>mahoneypat</dc:creator>
      <dc:date>2021-06-19T22:33:09Z</dc:date>
    </item>
    <item>
      <title>Re: API query return a range of selection</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/API-query-return-a-range-of-selection/m-p/1913775#M56585</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="56154" data-lia-user-login="clubspec" class="lia-mention lia-mention-user"&gt;clubspec&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;You can try to create a custom function like this and use it in the number table column:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;(Page as text) =&amp;gt;
let
    Source = Json.Document(Web.Contents("https://csv.business.tomtom.com/extern?account=AAAc&amp;amp;username=XXX&amp;amp;password=PPP&amp;amp;apikey=818c28e9-09ec-4...objectno="&amp;amp;Page&amp;amp;"&amp;amp;outputformat=json"))
in
    Source&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;let
    Source = List.Numbers(1,20,1),
    #"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    #"Changed Type" = Table.TransformColumnTypes(#"Converted to Table",{{"Column1", type text}}),
    Custom1 = Table.TransformColumns(#"Changed Type", {"Column1", each Text.PadStart(_, 3, "0"), type text}),
    #"Invoked Custom Function" = Table.AddColumn(Custom1, "function2", each function2([Column1]))
in
    #"Invoked Custom Function"&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team _ Yingjie Li&lt;BR /&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;I&gt;Accept it as the solution&lt;/I&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jun 2021 06:05:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/API-query-return-a-range-of-selection/m-p/1913775#M56585</guid>
      <dc:creator>v-yingjl</dc:creator>
      <dc:date>2021-06-22T06:05:18Z</dc:date>
    </item>
  </channel>
</rss>

