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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Is there a difference between parameters created in the UI and parameters written into a function?

I have a function that lists parameters and then uses them to paginate/offset an api query when invoked. This works fine, but I want to set them up so that I can adjust the parameters without invoking the function and creating a new query/dataset everytime. So, I set the same parameters up using the UI but now my pagination does not work. 

I'm wondering if there is some key difference between the two types of parameter, or more likely, what I'm missing that is causing it to break.

Here is the code that works;

let
    Source = (maxrecords as number, limitoffset as number, Token, optional query) => 
    if query = null or query = ""
    then List.Generate(
            ()=>[Counter = 0],
            each [Counter] < maxrecords,
            each [Counter = [Counter] + limitoffset],
            each Json.Document(Web.Contents("'URL'/api?limit=" & Number.ToText(limitoffset) & "&offset=" & Number.ToText([Counter]), [Headers=[ContentType="application/json", Authorization="Bearer " & Token]])))
            else List.Generate(
            ()=>[Counter = 0],
            each [Counter] < maxrecords,
            each [Counter = [Counter] + limitoffset],
            each Json.Document(Web.Contents("'URL'/api?limit=" & Number.ToText(limitoffset) & "&offset=" & Number.ToText([Counter]) & "&" & query, [Headers=[ContentType="application/json", Authorization="Bearer " & Token]])))

in
    Source

And this code (with the parameters set through the UI) only returns a single page of data.

let
    Source = if query = null or query = ""
    then List.Generate(
            ()=>[Counter = 0],
            each [Counter] < maxrecords,
            each [Counter = [Counter] + limitoffset],
            each Json.Document(Web.Contents("'URL'/api?limit=" & Number.ToText(limitoffset) & "&offset=" & Number.ToText([Counter]), [Headers=[ContentType="application/json", Authorization="Bearer " & Token]])))
            else List.Generate(
            ()=>[Counter = 0],
            each [Counter] < maxrecords,
            each [Counter = [Counter] + limitoffset],
            each Json.Document(Web.Contents("'URL'/api?limit=" & Number.ToText(limitoffset) & "&offset=" & Number.ToText([Counter]) & "&" & query, [Headers=[ContentType="application/json", Authorization="Bearer " & Token]])))
in
Source

I'm sure there's something I'm just not seeing, but I thought it would be worth checking to see if there is some fundamental difference between the two types of parameter that is causing an issue.

Thanks for taking a look!

2 REPLIES 2
v-eachen-msft
Community Support
Community Support

Hi @Anonymous ,

 

You could check if the parameter is decimal number in UI. After my tests, both of the methods could finish the cycle. So I think the problem is caused by parameter properties in UI.

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.
Anonymous
Not applicable

@v-eachen-msft Thanks for testing it. I've tried them as Any and as Decimal Number and still no luck. My UI doesn't seem to have an option for just plain Number.BI Screenshot.PNG

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors