I am trying to pass a URL parameter into a Retool REST API query, but the parameters contains a percentage sign (%). Due to this Retool encodes the value and replaces all percent signs into their encoded value (%25), which messes up the parameter.
Hi, does your API not accept URL escaped characters? Typically when a URL get sent with special characters (including %), it gets encoded with percent encoding, all APIs should be able to handle this. If this is still a problem you can try setting the cursor to be {{ encodeURI(cursorvalue.value) }}
Hi Bill, unfortunately this specific parameter (which is essentially a next page token) needs to be exactly the same and cannot be encoded at all. Otherwise the API is unable to find the next page. I agree that it is definitely a strange design choice to include a % in a next page token, and to not account for URL encoding, but sadly I don't own the API I am working with.
I went ahead and tried your suggestion, but that does the opposite -- I am trying to disable the encoding which automatically gets applied by retool when passing a variable as a URL parameter. So if a function like {{skipUriEncoding(cursorvalue.value)}} exists, or some other work-around that you can think of, or if this is simply not possible, please let me know.
Nevermind, I just realized that the cursor I was receiving had already been encoded, and passing it as a parameter led to it being encoded twice basically. I think I can work around this by decoding it first, then passing it as URL parameter.
This is a default JS function rather than a Retool specific one, but depending on how the string was originally encoded it would most likely be either decodeURI(value) or decodeURIComponent(value)