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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Ivancito111
Resolver I
Resolver I

API Queries

Good afternoon dear,

It is the first time that I work with API's in PBI and I do not handle correctly all the concepts/errors that they can carry out.


I have to connect to an API and extract the data of the workers.

API documentation: https://demo.buk.cl/apidocs#/

 

Employees: 

 

 

= (Page as number) =>
let
    Source = Json.Document(Web.Contents("INSERT URL?page="&Number.ToText(Page), [Headers=[token="xxxxxxxxxxxxxxx"]])),
    data = Source[data],
    #"Converted to Table" = Table.FromList(data, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    #"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"full_name", "rut"}, {"full_name", "rut"})
in
    #"Expanded Column1"

 

 

Query:

 

 

= List.Generate(()=> 
[Result = try employees(1) otherwise null, Page = 1], 
each [Result] <> null, 
each [Result = try employees([Page]+1) otherwise null, Page = [Page]+1],
each [Result])

 

 

Tutorial I followed: https://www.youtube.com/watch?v=05yhwnuCjRw

 

There is no problem in the data I get, but the problem starts when I need to update it automatically in PBI Service, where I get the following error:

Ivancito111_0-1649347971033.png

English translation:

This dataset includes a dynamic data source. Since these sources are not updated in the Power BI service, this dataset will not be updated. Learn more at https://aka.ms/dynamic-data-sources.
Query1 data source

 

I would like if someone could guide me what modification should I make to update automatically or if it is already impossible to update in this way.

 

Thank you very much for your time, have a nice day.

1 ACCEPTED SOLUTION
v-kkf-msft
Community Support
Community Support

Hi @Ivancito111 ,

 

Please try use the Query option in Web.contents function:

 

(Page as number) =>
let
    Source = Json.Document(Web.Contents("https://xxxx/api/v1/chile/employees",[Query=[page=Number.ToText(Page)], Headers=[auth_token="xxxxxx"]])),
    data = Source[data],
    #"Converted to Table" = Table.FromList(data, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    #"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"full_name", "rut"}, {"full_name", "rut"})
in
    #"Expanded Column1"
let
    Query1 = List.Generate(()=> 
[Result = try employees(1) otherwise null, Page = 1], 
each [Result] <> null, 
each [Result = try employees([Page]+1) otherwise null, Page = [Page]+1],
each [Result]),
    Query2 = Query1{0}
in
    Query2

 

Then publish report and select "Skip test connection" for this data source.

 

vkkfmsft_0-1649669215906.pngvkkfmsft_1-1649669236225.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

1 REPLY 1
v-kkf-msft
Community Support
Community Support

Hi @Ivancito111 ,

 

Please try use the Query option in Web.contents function:

 

(Page as number) =>
let
    Source = Json.Document(Web.Contents("https://xxxx/api/v1/chile/employees",[Query=[page=Number.ToText(Page)], Headers=[auth_token="xxxxxx"]])),
    data = Source[data],
    #"Converted to Table" = Table.FromList(data, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    #"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"full_name", "rut"}, {"full_name", "rut"})
in
    #"Expanded Column1"
let
    Query1 = List.Generate(()=> 
[Result = try employees(1) otherwise null, Page = 1], 
each [Result] <> null, 
each [Result = try employees([Page]+1) otherwise null, Page = [Page]+1],
each [Result]),
    Query2 = Query1{0}
in
    Query2

 

Then publish report and select "Skip test connection" for this data source.

 

vkkfmsft_0-1649669215906.pngvkkfmsft_1-1649669236225.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.