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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors