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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
JM-CV
Regular Visitor

Avoid URL encoding in the Query of Web.Contents

Hello all, 

 

In order to avoid a dynamic url in Web.Contents (to automatcaly refresh dashboard in Power BI Services), and given tha paging system of the Azure API, I wrote the code below to achieve so, but I found out that in the HTTP request, the Path variable in query_param is url-encoded, making it differentto the URL expected by the API. 

 

Is there any way to disable this enconding or do you know another approach to change the parameters of the URL properly?

 

Thank you in advance.

 

 

let
        GetPages = (Path as text)=>
        let
            Host = "https://management.azure.com/subscriptions/xxxxxx/providers/Microsoft.Compute/virtualMachines?api-version=2022-11-01",
			query_param= [#"api-version"=Path],

            Source = Json.Document(
                Web.Contents(
                    Host, 
                    [Query = query_param]
                )),
            LL= @Source[value],
 
            Next = Text.Replace(Source[#"nextLink"], Host, ""),
            result = try @LL & @GetPages(Next) otherwise @LL
        in
        result,

        Host = "https://management.azure.com/subscriptions/xxxxxx/providers/Microsoft.Compute/virtualMachines?api-version=2022-11-01",
        Source = Json.Document(Web.Contents(Host)),
        Next = Text.Replace(Source[#"nextLink"], Host, ""),
        first= @Source[value],
        Fullset = first&GetPages(Next)

in Fullset

 

2 REPLIES 2
iBusinessBI
Kudo Collector
Kudo Collector

Any solution? Same here. My Query parameters automaticaly get encoded so instead of the correct parameter:

search=(status:(values:List(ACTIVE)))  
The following is what gets requested and I get 400 Bad request
search=%28status%3A%28values%3AList%28ACTIVE%29%29%29 
How can I prevent it from encoding?
lbendlin
Super User
Super User

Please remove the query parameters from the base URL.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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

Top Solution Authors