Question

Valaris PLC
US
Last activity: 7 Mar 2025 18:31 EST
Connect Rest - Space Character in the URL path is getting encoded as "+" instead of "%20"
Hi,
We have a rest connector where the endpoint url path has a dynamic file name component in it. Sometimes the file names contain special character, so we have to encoded the file name using the out of the box function "encodeURL", while forming the full end point. But, we have an issue now with file names which contain space character in it, like for example "Test + File.pdf". In this case, it is encoding the file name string as "Test+%2B+File" instead of "Test%20%2B%20File". This is causing the API to fail.
I even tried the "encodeURLParameter" OOTB function, but still the same result.
Upon some research we found that a javascript function "encodeURIComponent" actually works well (when added to a text file rule and referenced in the harness/section) and encodes the text just like how we want. But, we are not processing this feature from a front end UI (in which case we could have used the JS), but this is being called in an email listener processing.
Is there a way to use the JS function directly on the DT/Activity level or is there any other way in the DT/Activity to encode the string just like how the JS function does?
Thank you