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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Employee
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
Employee
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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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