Query Parameter Encoding Issue: Spaces encoded as + but API encodes it as %20 - Is there a workaround?
Hello Appian Community,
I'm experiencing a URL encoding challenge with query parameters in an integration and would like to know if there's a solution or workaround.
The Problem:
I need to pass query parameter values that contain spaces (e.g., "North America") to an external API via a GET request. When I use Appian's standard Query Parameters in my integration object, the spaces are encoded as + signs, resulting in ?searchText=North+America.
However, the external API we're integrating with does not recognize + as a space character and requires spaces to be encoded as %20 (i.e., ?searchText=North%20America).
What I've Tried:
- Pre-encoding the parameter with substitute() - Replacing spaces with
%20before passing to the integration causes double encoding, resulting in%2520because Appian encodes the%character itself - Using
urlwithparameters()function - Still produces+encoding for spaces, which follows theapplication/x-www-form-urlencodedstandard - Standard Query Parameters section - Consistently encodes spaces as
+signs - Building URL manually in Relative Path - Same encoding behavior
My Questions:
- Is there any way in Appian to force query parameters to use
%20encoding for spaces instead of+encoding? - Is it even possible to pass literal spaces (unencoded) in query parameter values, or will Appian always encode them?
- Are there any alternative approaches or workarounds to handle this scenario?
Additional Context:
- Integration uses a Connected System with GET method
- Cannot modify the external API to accept
+encoding - API endpoint only accepts GET requests (POST with JSON body is not an option)
- Cannot change the parameter values to avoid spaces (business requirement)
Has anyone encountered a similar issue or found a workaround for controlling the URL encoding format in Appian integrations?
Thank you in advance for any guidance!
