Special characters in languages like French or Arabic that are sent in resource path parameters to scripted REST API (setRedirectURL) are not passed correctly and do not properly encode values.

Steps to Reproduce

1. Create a UI action on the incident table with the following details:
Name: Copy Short Description to new Incident
Form Link: checked
var sd = current.short_description.toString();
action.setRedirectURL("" + sd);

2. Create a new incident.

3. Set the value of short description to: Québécois.

4. Save the record.

5. Click on the UI Action form link created in step1. The short description does not display the special characters properly.


6. Create a scripted REST API
Example end point: /api/snc/hello_nonascii_world/{pathParamValue}
(function process(/*RESTAPIRequest*/ request, /*RESTAPIResponse*/ response) {
gs.log("request.uri: " + request.uri); // < bad chars here
var pathParams = request.pathParams;
var pathParamValue = pathParams.pathParamValue;
gs.log("pathParamValue="+pathParamValue); < bad chars here
})(request, response);

7. Send request to this point with Arabic characters as path parameter:
curl "طالب" --header "Accept:application/json" --user 'admin':'xxxxxxxx' --verbose

Instance logs print invalid characters:
request.uri: /api/snc/hello_nonascii_world/طالب


This problem is under review and targeted to be fixed in a future release. To receive notifications when more information becomes available, subscribe to this Known Error article by clicking the Subscribe button at the top right of this form.

As a workaround, send the special characters as query parameters instead of path parameters. For example:
curl "طالب" --header "Accept:application/json" --user 'admin':'xxxxxxxxxx' --verbose

Example REST API script:
(function process(/*RESTAPIRequest*/ request, /*RESTAPIResponse*/ response) {
var queryParams = request.queryParams;
})(request, response);

Related Problem: PRB1327177

Seen In

There is no data to report.

Intended Fix Version


Safe Harbor Statement

This "Intended Fix Version" information is meant to outline ServiceNow's general product direction and should not be relied upon in making a purchasing decision. The information provided here is for information purposes only and may not be incorporated into any contract. It is not a commitment, promise, or legal obligation to deliver any material, code, or functionality. The development, release, and timing of any features or functionality described for our products remains at ServiceNow's sole discretion.

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2020-01-16 15:33:18