cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

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

Accepted Solutions
Highlighted
Microsoft
Microsoft

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
Highlighted
Microsoft
Microsoft

Change that last step in your Value query to:

Value1{0}

or

List.First(Value1)

or

List.Single(Value1)

View solution in original post

Highlighted

thank you!

Highlighted

**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

Highlighted

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 = [...]])

 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Community Conference

Microsoft Power Platform Communities

Check out the Winners!

secondImage

Create an end-to-end data and analytics solution

Learn how Power BI works with the latest Azure data and analytics innovations at the digital event with Microsoft CEO Satya Nadella.

Top Solution Authors
Top Kudoed Authors