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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
asherbowden
Frequent Visitor

Query parameter's with special characters

Hi there,

 

I am using dataflows calling a Web API.

 

I am using Web.Contents with the RelativePath, Query arguments in order to ensure I can schedule a refresh with the query.

 

My particular URL I am calling has a special character in the Query Parameter.

 

E.g. www.XXX.com/YYY/?example-parameter=abc

 

Note the dash in the middle. This translates to Mcode that looks like this.

 

Web.Contents("www.XXX.com/",

[RelativePath = "YYY",  Query = [example-parameter = "abc"]])

 

I have seen blog posts on how to address special characters in the argument (in the above case "abc") using the URI functions to encode.

https://docs.microsoft.com/en-us/powerquery-m/uri-functions

 

HOWEVER, I cannot seem to encode the actual Query parameter.

It is key to note that it must be able to dynamcially refresh in order to schedule a refresh for the dataflow.

 

Please let me know if someone has found a solution to this!

 

 

1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

Try this:

Query = [#"example-parameter" = "abc"]

 

A hyphen isn't a character that needs to be encoded for a URL, but M needs some help to know that "example" and "parameter" belong together.

View solution in original post

4 REPLIES 4
asherbowden
Frequent Visitor

Fantastic, this worked well. Appreciate it Alexis.

AlexisOlson
Super User
Super User

Try this:

Query = [#"example-parameter" = "abc"]

 

A hyphen isn't a character that needs to be encoded for a URL, but M needs some help to know that "example" and "parameter" belong together.

Hi @AlexisOlson ,

 please could you help me, how do i replace %

date_from="2021-06-01%2012:01:01",
date_to="2021-06-30%2012:01:01",

 

i get this &date_from=2021-06-01%252012%3A01%3A01&date_to=2021-06-30%252012%3A01%3A01&

 

Hey mate, did you manage to solve this? I too have special characters "%" in the name I am trying to combine.

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
Top Kudoed Authors