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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
pinkukumar
Frequent Visitor

facing error while dynamically passing a function (JobId) in URL (advance editor) in Dataset

I am facing below error while dynamically passing a function (JobId)  in URL (advance editor) in Dataset and getting below error-

pinkukumar_0-1714641702491.jpeg

 

While trying to change the Type as Anonymous, Seeing below in data source settings-

pinkukumar_1-1714641728098.jpeg

JobId function code written for generating dynamic JobId-

pinkukumar_2-1714641891679.png

 

Dataset code from advance editor-

pinkukumar_3-1714642001534.png

 

If I am using hardcoded value for JobId then It's working fine -

URL="https://XXX.XXX.com/api/v3/job/19cf1416-afe2-00d0-8f2d-897d3a75ac00/results?offset=0&limit=500"

Can someone please help on this?, Thanks in Advance.
@powerquery
@

4 REPLIES 4
pinkukumar
Frequent Visitor

Thanks @lbendlin . The Relative Path and Query options are working fine and It loads data for same. Below is the M-query code written for same. We are getting error while refreshing the preview.

let
URL="https://XXXXXX.XXXXXX.com/api/v3/job/",
headers=[Accept="application/json", #"Content-Type"="application/json", #"Authorization"="_dremio"&Token(), Method="GET"],
Source = Web.Contents(URL,[RelativePath=JobId()&"/results/",Headers=headers]),
response = Json.Document(Source),
#"Converted to Table" = Record.ToTable(response),
Value = #"Converted to Table"{2}[Value],
#"Converted to Table1" = Table.FromList(Value, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table1", "Column1", {"Testprocedure", "test_procedure_id", "Scopename", "ScopeId", "observation_title", "analytics_audit_procedures"}, {"Testprocedure", "test_procedure_id", "Scopename", "ScopeId", "observation_title", "analytics_audit_procedures"})
in
#"Expanded Column1"


But when I try to refresh preview, Getting below error-

pinkukumar_1-1714980179317.png

 

Also not able to apply the changes because of the above error.

pinkukumar
Frequent Visitor

I didn't find that the function as getting passed in URL in mentioned web-contents link-
Web.Contents - PowerQuery M | Microsoft Learn

It's not helpful.

please read the documentation again.  You need to use RelativePath and Query if you want to be able to refresh your data source from the Power BI Service.

lbendlin
Super User
Super User

Please use the RelativePath and Query options

 

Web.Contents - PowerQuery M | Microsoft Learn

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.