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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

address json element in M code

I'm trying to get a specific value from a json return, to use as a variable in the pagination script.

 

Postman returns this on the query:

{
    "collection": [],
    "pagination": {
        "maxPageSizeAllowed"1000,
        "skipPages"0,
        "pageSize"1,
        "results"120,
        "resultsWithoutFilter"120,
    },
}
 
 
How do I address the field resultsWithoutFilter
 
I have some code snippet from powerbi:
 
= () =>
let Url = BaseUrl & "pagesize=1&skippages=0", //get the first entry for sake of getting the total
Json = GetJson(Url),
Count = Json{{1}{4}}
in Count
 
it's the Count=Json ... part I'm looking for.
1 ACCEPTED SOLUTION
PhilipTreacy
Super User
Super User

Hi @Anonymous 

Based on the JSON above you should see this when you click on the Json step 

json-resp.png

So you can use this to get the value in resultsWithoutFilter

 

Count = Json[pagination][resultsWithoutFilter]

 

Regards

Phil


If I answered your question please mark my post as the solution.
If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

3 REPLIES 3
PhilipTreacy
Super User
Super User

Hi @Anonymous 

Based on the JSON above you should see this when you click on the Json step 

json-resp.png

So you can use this to get the value in resultsWithoutFilter

 

Count = Json[pagination][resultsWithoutFilter]

 

Regards

Phil


If I answered your question please mark my post as the solution.
If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


amitchandak
Super User
Super User

@Anonymous , refer if this blog can help

https://medium.com/@marktiedemann/how-to-do-pagination-in-power-query-430460c17c78

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hi @amitchandak , thanks. I'm using that code as basis, but it's not an odata streamt. I'm having trouble extracting (addressing) the "resultsWithoutPages" attribute from the json response. If a just put a constant the code works just fine. It's me just not getting/ finding information on how to address the attributes in the json response, I guess.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

Top Solution Authors
Top Kudoed Authors