Hi, hoping someone can help here.
I have built a custom connector, all works fine providing I don't provide multiple values for an array parameter.
The original URL could look like:
http://example.com/api/v2/events?processId=10,20,30
I've defined the Custom Connector definition using Swagger, below is a snippet of what has been defined for this action:
@mapedad :This works perfectly! Thanks for posting the solution.
A note to others who find this solution. I first understood the issue by looking at the actual request (see screenshot below) using the Testing feature in power automate custom connector, where a query parameter called "$expand" was url encoded to become "%24expand". Each time I send the request, the $expand parameter was ignored, and I now know that it became unrecognizable after url encoding.
After adding the custom code, the $expand parameter worked as expected. However, I noticed that in the response with the testing area (see screenshot below), it looks like it's still URL encoded, leading me to believe it was not working. The response turned out to be correct, so the testing "request" is shown as it exists without the additional custom code.
Hello folks!
I encountered the same issue where the Custom connector always encoded the escape characters into the URL. To address this, I implemented a simple workaround by using custom code within the connector. Here's how you can do it:
public class Script : ScriptBase
{
public override async Task<HttpResponseMessage> ExecuteAsync()
{
// get current request Uri
var strRequestUri = this.Context.Request.RequestUri.AbsoluteUri;
var strRequestUriDecode = (HttpUtility.UrlDecode(strRequestUri));
this.Context.Request.RequestUri = new Uri(strRequestUriDecode);
HttpResponseMessage response = await this.Context.SendAsync(this.Context.Request, this.CancellationToken).ConfigureAwait(continueOnCapturedContext: false);
return response;
}
}
Hope it helps!
Bumping this. I'm having a similar issue:
Setting up a custom connector, I need to add a token to the query, and the token involves the '%' character, which is automatically URL encoded. This encoding then sends the request to the incorrect place, so the connection isn't ever made.
I found x-ms-skip-url-encoding and tried integrating this, with and without x-ms-paths. However, it does not seem to stop the url encoding from happening.
If there is a way to stop this url encoding please reply, microsoft! There are ways with Swagger (allowReserved: true WOULD work, but it isn't supported??) I can even edit the Swagger UI code and get the code to POST to my webhook. I can 'execute' the code within that test area, and it works fine, but the editor doesn't let me save my Swagger code because it doesn't like what I had to do to get Swagger to send the string '?token=XXX%234%XXXXXXX' without it encoding the reserved characters.
Please take a look at this! It seems like a really simple thing, it could just be allowed in the parameters section of the custom connector, where you can choose 'string, date, binary, byte' etc. where if in the 'query' it will turn the 'allowReserved' for that parameter to 'true'.
Michael E. Gernaey
497
Super User 2025 Season 2
David_MA
436
Super User 2025 Season 2
Riyaz_riz11
244
Super User 2025 Season 2