Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Sankzpower
Helper I
Helper I

Restrict API call till it reaches certain value

Hi all

 

Hope someone can help.

The data which I retrive from API call contains three properties such as hasMore, items and errors.
hasMore will be true if there are more items to be returned, items will contain an array of the type of data requests.
Each of them has data inside it for example: hasMore signifies whether the pages contains more data or not so its always
be either True or Fale. Currently, I have a query which pulls in the data by definite page number so currently it set
to page 50 so query runs for page 50. Each pages contains 100 rows hence I had to go through each pages to retrieve all
data. Below is an simple example code which I use to retrieve

 

Capture.JPG

 

 

let
    Source = Json.Document(Web.Contents("https://cloud.com/api/user?apiKey=c661b7&orderby=name&page=1")),
    #"Converted to Table" = Record.ToTable(Source),
    Value = #"Converted to Table"{0}[Value],
    #"Converted to Table1" = Table.FromList(Value, Splitter.SplitByNothing(), null, null, ExtraValues.Ignore),
    #"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table1", "Column1", {"id", "name", "utilityCategoryId", "utilityId", "isARec"}, {"id", "name", "utilityCategoryId", "utilityId", "isARec"})
in
    #"Expanded Column1"

 

 

 

 

 

 

However, I am looking to see if I can use "HasMore" to retrieve data from multiple pages until query hits HasMore FALSE?
Not sure, if its possible - any help would be appreciated?

Thanks

2 REPLIES 2
v-diye-msft
Community Support
Community Support

hi @Sankzpower 

 

Sorry I can't repro the issue on my side, please kindly raise it to the support team for better advice:

https://powerbi.microsoft.com/en-us/support/ 

Support Ticket.gif

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

hi @v-diye-msft  thanks, but this is not an issue sorry. I was asking if we can restrict query run until it hits with fieldname called "False" as stated in above example.

 

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.