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
Anonymous
Not applicable

Power Query API Source dynamic token

Hello All,

 

I would like to get the value from another table and past it as a filter on my Source(nextPageToken=&Value) on the screenshot below.

 

Nextpagetoke

Anyone could help me with the below problem?

 

 

 

Screen Shot 2020-03-20 at 5.17.03 PM.pngScreen Shot 2020-03-20 at 5.18.54 PM.png

 

Thank you,

 

Ann

1 ACCEPTED SOLUTION
artemus
Microsoft Employee
Microsoft Employee

Change that last step in your Value query to:

Value1{0}

or

List.First(Value1)

or

List.Single(Value1)

View solution in original post

4 REPLIES 4
artemus
Microsoft Employee
Microsoft Employee

Change that last step in your Value query to:

Value1{0}

or

List.First(Value1)

or

List.Single(Value1)

Anonymous
Not applicable

**OK I should have read into the error, instead of assuming it was my dodgy code**

 

I ended up merging my two queries into one, causing PowerBi to prompt me about data source settings. I believe I ticked 'Anonymous'. Now my query works as expected.

 

For others, click on your query > data source settings > edit permissions > edit.

 

 

 

Hi @artemus 

 

I'm having a similar issue to the OP of this thread. Only, your suggested solutions aren't working 😞

 

My 'token' query:

 

 

let
    Source = Json.Document(Web.Contents("<url>", 
    [Headers=
    [<headers>]])),
    #"Converted to Table" = Record.ToTable(Source),
    Value = #"Converted to Table"[Value],
    token = Value{0}
in
    token

 

 

 

I successfully get a token:

 

 

eyJhbGciOiJSUzI1NiIsImtpZCI6ImQxMGM4ZjhiMGRjN2...

 

 

 

My 'get data' query:

 

 

let
    Source = Json.Document(Web.Contents("<url>", 
    [Headers=
    [#"xxx"="xxx",
    #"Authorization"= "Bearer " & token,
    #"Content-Type"="application/json"]]))
in
    Source

 

 

 

The error:

 

 

Formula.Firewall: Query 'get data' (step 'Source') references other queries or steps, so it may not directly access a data source. Please rebuild this data combination.

 

 

 

Any ideas what's wrong here?

 

Thanks

Use the RelativePath option to put the part of your URL after the domain. The url parameter must be a string literal or a direct reference to a parameter.

 

E.g.

 

Web.Contents("mydomain.com", [RelativePath = tokenUrl, Headers = [...]])

 

Anonymous
Not applicable

thank you!

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.