Skip to page contentSkip to chat
ServiceNow support
    • Community
      Ask questions, give advice, and connect with fellow ServiceNow professionals.
      Developer
      Build, test, and deploy applications
      Documentation
      Find detailed information about ServiceNow products, apps, features, and releases.
      Impact
      Accelerate ROI and amplify your expertise.
      Learning
      Build skills with instructor-led and online training.
      Partner
      Grow your business with promotions, news, and marketing tools
      ServiceNow
      Learn about ServiceNow products & solutions.
      Store
      Download certified apps and integrations that complement ServiceNow.
      Support
      Manage your instances, access self-help, and get technical support.
Special characters (i.e.: French, Arabic) passed in resource path parameters to scripted REST API / setRedirectURL do not encode correctly - Known Error
  • >
  • Knowledge Base
  • >
  • Known Error (Knowledge Base)
  • >
  • Special characters (i.e.: French, Arabic) passed in resource path parameters to scripted REST API / setRedirectURL do not encode correctly
KB0750175

Special characters (i.e.: French, Arabic) passed in resource path parameters to scripted REST API / setRedirectURL do not encode correctly


1983 Views Last updated : Jul 10, 2023 public Copy Permalink
KB Summary by Now Assist

Description

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
Script:
var sd = current.short_description.toString();
action.setRedirectURL("incident.do?sys_id=-1&sysparm_query=short_description=" + 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}
Script:
(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 "https://INSTANCE.service-now.com/api/snc/hello_nonascii_world/طالب" --header "Accept:application/json" --user 'admin':'xxxxxxxx' --verbose

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

Workaround

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 "https://INSTANCE.service-now.com/api/snc/hello_nonascii_world/pathParamValue?nonasciivalue=طالب" --header "Accept:application/json" --user 'admin':'xxxxxxxxxx' --verbose

Example REST API script:
(function process(/*RESTAPIRequest*/ request, /*RESTAPIResponse*/ response) {
var queryParams = request.queryParams;
gs.log("queryParamTest="+queryParams.nonasciivalue);
})(request, response);


Related Problem: PRB1327177

The world works with ServiceNow.

Sign in for more! There's more content available only to authenticated users Sign in for more!
Did this KB article help you?
Did this KB article help you?

How would you rate your Now Support digital experience?

*

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

What can we improve? Please select all that apply.

What are we doing well? Please select all that apply.

Tell us more

*

Do you expect a response from this feedback?

  • Terms and conditions
  • Privacy statement
  • GDPR
  • Cookie policy
  • © 2025 ServiceNow. All rights reserved.