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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
LoScalzo
New Member

Hand-authored queries issue when using dynamic sources.

Hello everyone,

 

I came across this https://blog.crossjoin.co.uk/2018/12/10/credentials-data-privacy-settings-and-data-sources-in-power-... when I was searching for solution to this issue. Tried a lot but couldn't solve it. So here I am 🙂

 

Chris modified his code from 

 

let
Source =
Json.Document(
Web.Contents(
"https://data.gov.uk/api/3/action/package_search?q=cows"
)
),
result = Source[result],
results = result[results],
results1 = results{0},
id = results1[id],
output =
Json.Document(
Web.Contents(
"https://data.gov.uk/api/3/action/package_show?id=" & id
)
)
in
output

 

 

to:

 

let
Source =
Json.Document(
Web.Contents(
"https://data.gov.uk/api/3/action/package_search?q=cows"
)
),
result = Source[result],
results = result[results],
results1 = results{0},
id = results1[id],
output =
Json.Document(
Web.Contents(
"https://data.gov.uk/api/3/action/package_show",
[Query=[#"id"=id]]
)
)
in
output

 

 

How would you do with this code snippet if using similiar solution?

 

(GROUPS as text)=>
let
    Source = Json.Document(Web.Contents("https://clock.service-now.com/api/now/table/sys_user_group/"&GROUPS&" -H Authorization: Bearer &""GetAccesstoken()""")),
    #"Converted to Table" = Table.FromRecords({Source}),
    #"Expanded result" = Table.ExpandRecordColumn(#"Converted to Table", "result", {"name"}, {"name"})
in
    #"Expanded result"

 

 

Have a great day,

LoScalzo

3 REPLIES 3
Syndicate_Admin
Administrator
Administrator

RelativePath, not Query.

LoScalzo
New Member

Hello Syndicate_Admin, 

 

Thank you for the link but I cannot use Query it will create a question mark. 

I need URL + Variable like this (www.microsoft.com/Variable with static url in Web.Content and then use something below to link it. 

Syndicate_Admin
Administrator
Administrator

Please read the documentation.  There are examples of how to use RelativePath and how to specify Headers.

 

Web.Contents - PowerQuery M | Microsoft Learn

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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