<?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: GetTotalPage by m code function (Source data is API) in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/GetTotalPage-by-m-code-function-Source-data-is-API/m-p/2656022#M37512</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/343222"&gt;@chrisyan_manalu&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Need some addtional information to help.&amp;nbsp;Can you possibly paste the code in text, I am unable to see it, too small.&amp;nbsp;Also, click on the error and paste in what the error text is.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Fri, 22 Jul 2022 15:02:50 GMT</pubDate>
    <dc:creator>m-colbert</dc:creator>
    <dc:date>2022-07-22T15:02:50Z</dc:date>
    <item>
      <title>GetTotalPage by m code function (Source data is API)</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/GetTotalPage-by-m-code-function-Source-data-is-API/m-p/2655209#M37506</link>
      <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm stuck right now&lt;/P&gt;&lt;P&gt;I have code like this to get how much the total page of this API (source data)&lt;/P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="chrisyan_manalu_0-1658480543454.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/752599iF407CD35317ADD94/image-size/medium?v=v2&amp;amp;px=400" role="button" title="chrisyan_manalu_0-1658480543454.png" alt="chrisyan_manalu_0-1658480543454.png" /&gt;&lt;/span&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And when I try to invoke custom function, I got error like this&lt;/P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="chrisyan_manalu_1-1658480543283.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/752598i151637CFBBA73963/image-size/medium?v=v2&amp;amp;px=400" role="button" title="chrisyan_manalu_1-1658480543283.png" alt="chrisyan_manalu_1-1658480543283.png" /&gt;&lt;/span&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the function running well, the output present how much the total page&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any solution ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 22 Jul 2022 09:03:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/GetTotalPage-by-m-code-function-Source-data-is-API/m-p/2655209#M37506</guid>
      <dc:creator>chrisyan_manalu</dc:creator>
      <dc:date>2022-07-22T09:03:39Z</dc:date>
    </item>
    <item>
      <title>Re: GetTotalPage by m code function (Source data is API)</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/GetTotalPage-by-m-code-function-Source-data-is-API/m-p/2656022#M37512</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/343222"&gt;@chrisyan_manalu&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Need some addtional information to help.&amp;nbsp;Can you possibly paste the code in text, I am unable to see it, too small.&amp;nbsp;Also, click on the error and paste in what the error text is.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jul 2022 15:02:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/GetTotalPage-by-m-code-function-Source-data-is-API/m-p/2656022#M37512</guid>
      <dc:creator>m-colbert</dc:creator>
      <dc:date>2022-07-22T15:02:50Z</dc:date>
    </item>
    <item>
      <title>Re: GetTotalPage by m code function (Source data is API)</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/GetTotalPage-by-m-code-function-Source-data-is-API/m-p/2657841#M37532</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/378028"&gt;@m-colbert&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Here's the code&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(SelectedService as text) =&amp;gt;
    let
    BaseURL = "https://testing.com", //example API
    ConstantVar = "test/rest/CheckAPI/GetData?PageSize=""&amp;amp;PageNumber=""&amp;amp;Building=""&amp;amp;Category=""&amp;amp;Location=""&amp;amp;Status=""&amp;amp;StartDate=""&amp;amp;EndDate=""&amp;amp;StartTime={StartTime}&amp;amp;EndTime=", // example var
    StartDate = "2021-10-19",
    CurrentYear = Text.End("0000" &amp;amp; Number.ToText(Date.Year(Date.From(DateTime.LocalNow()))),4),
    CurrentMonth = Text.End("00" &amp;amp; Number.ToText(Date.Month(Date.From(DateTime.LocalNow()))),2),
    CurrentDay = Text.End("00" &amp;amp; Number.ToText(Date.Day(Date.From(DateTime.LocalNow()))),2),
    EndDate = CurrentYear &amp;amp; "-" &amp;amp; CurrentMonth &amp;amp; "-" &amp;amp; CurrentDay,
    response = Web.Contents(
    #"BaseURL",
    [
        Headers = 
        [
            Authorization= "test test" // username and pass (basic auth)
        ],
        RelativePath = #"ConstantVar" &amp;amp; SelectedService,
        Query = 
        [
            start_dt = StartDate,
            end_dt = EndDate,
            page = Number.ToText(1)
        ]
    ]
),
    jsonResponse = Json.Document(response),
    #"Converted to table" = Record.ToTable(jsonResponse),
    #"Filtered rows" = Table.SelectRows(#"Converted to table", each ([Name] = "total_page")),
    #"Removed columns" = Table.RemoveColumns(#"Filtered rows", {"Name"}),
    #"Changed column type" = Table.TransformColumnTypes(#"Removed columns", {{"Value", Int64.Type}}),
    #"Renamed columns" = Table.RenameColumns(#"Changed column type", {{"Value", "TotalPage"}})
in
    #"Renamed columns"&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thaks&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2022 02:25:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/GetTotalPage-by-m-code-function-Source-data-is-API/m-p/2657841#M37532</guid>
      <dc:creator>chrisyan_manalu</dc:creator>
      <dc:date>2022-07-25T02:25:22Z</dc:date>
    </item>
  </channel>
</rss>

