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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Anonymous
Not applicable

Discover data source

Dears, 

I have an issue when I'm using the Rest API, when I'm using it in the local desktop it works fine but when I tried to publish it, the refresh not working an give this error: 

Dynamic data source.PNG

 

In my case: I have a list of pages for each student "let us say", and I iterate over all pages that related to the student to get the list of subjects and the Auth for each, after that I invok that key for each student and each subject to get the clasess:

 

 

 

let 
    
    
    MainUrl =Json.Document(Web.Contents("https://StudentAdmin.com/api/Student?page=", [Headers=[Authorization="Bearer XXXXXXXXXXXXXXXXXXX",Accept="application/json",#"Content-Type"="application/json"]])),
    meta1 = MainUrl[meta],
    last_page = {1.. meta1[last_page]},
    #"Converted to Table" = Table.FromList(last_page, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    #"Changed Type" = Table.TransformColumnTypes(#"Converted to Table",{{"Column1", type text}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Student", each let
    Source = Json.Document(Web.Contents("https://StudentAdmin.com/api/Student?page="&[Column1]&"", [Headers=[Authorization="Bearer XXXXXXXXXXXXXXXXXXX", Accept="application/json", #"Content-Type"="application/json"]])),
    data = Source[data]
in
    data),
    #"Expanded Student" = Table.ExpandListColumn(#"Added Custom", "Student"),
    #"Expanded Student1" = Table.ExpandRecordColumn(#"Expanded Student", "Student", {"id", "country_iso_code", "name"})
    in 

    #"Expanded Student1"

 

And as Chris mention in his post to use the relative path, i have change the code to use the same idea but still is not getting the credentials

 

Scheduled refresh is disabled because at least one data source is missing credentials. To start the refresh again, go to this dataset's settings page and enter credentials for all data sources. Then reactivate scheduled refresh.

Any Idea? 

1 REPLY 1
lbendlin
Super User
Super User

You can't do this:

MainUrl =Json.Document(Web.Contents("https://StudentAdmin.com/api/Student?page=",

Either drop the page parameter, or provide a dummy value.

MainUrl =Json.Document(Web.Contents("https://StudentAdmin.com/api/Student",

That will trick the service into thinking it's not a dynamic URL. Then use the [query=...] option to specify your parameters.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.