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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Anonymous
Not applicable

Stop Web.Contents Query Parameter from Encoding

I'm attempting to submit the following in Power Query:

 

Web.Contents(
     www.myurl.com/stuff.json
     , [
          Query = [
               created = "[Select+Date+Range]&created_custom_gte=[" & EarlierstDate & "T00:00:00.000000+0000]"
          ]
     ]
)

 

 

However, when it actually makes the web call it's encoding the "created" parameter which is causing the API call to fail.

 

Expectedwww.myurl.com/stuff.json?created=[Select+Date+Range]%26created_custom_gte=[2020-05-01T00:00:00.000000+0000]

Actualwww.myurl.com/stuff.json?%5BSelect%2BDate%2BRange%5D%26created_custom_gte%3D%5B2020-05-01T00%3A00%3A00.000000%2B0000%5D

 

Thanks!

5 REPLIES 5
iBusinessBI
Kudo Collector
Kudo Collector

Same here. Any suggestions?

amitchandak
Super User
Super User

@Anonymous , Looking at how url should go I think it should be like

 

Web.Contents(
"www.myurl.com/stuff.json",
, [
Query = [
created = "[Select+Date+Range]&created_custom_gte=[" & EarlierstDate & "T00:00:00.000000+0000]"
]
]
)

 

There is a good reference on dynamic URL here -https://blog.crossjoin.co.uk/2016/08/16/using-the-relativepath-and-query-options-with-web-contents-in-power-query-and-power-bi-m-code/

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak 

 

Not sure if I'm missing something... That looks like the exact code I put in the original post?

 

As stated, the query string encodes the value in the key value pair which causes the API request to fail.

Any solution?

Greg_Deckler
Community Champion
Community Champion

@ImkeF @edhans 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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