How to replace special character (/) with a space in Business rules

Priyanka145
Tera Contributor

Hi All,

Having some issue with getting an error message on a REST web service.

Over the BR, I have kept  as below to replace special characters in short description.

r.setStringParameterNoEscape('short_description', current.short_description.replace(/[\\"_'ø:*]/g, " "));

It is working for all the special characters except '/'. Please guide me what changes to be made to achieve this.

Example:

Hi,

2/03/31 23.51 APISM610 CPU1 3 WPIS6157 0032
22/03/31 23.51 APISM610 CPU1 15 WPIS6162 0047

In the request body, I am seeing as below :

"short_description":"Hi,\n\n2/03/31 23.51 APISM610          CPU1   3 WPIS6157 0032\n22/03/31 23.51 APISM610          CPU1 15 WPIS6162 0047"

and in response body, receiving this: 

[ERROR CODE: 400 ] Method failed: (/dev_servicenow_incident_tkts/_doc/INC0149665) with code: 400 

Please guide me how to resolve this.

 

5 REPLIES 5

Tony Chatfield1
Kilo Patron

Hi, your question is not very clear and the data seems to be an unusual combination to be pasting into a string field that is single line. Perhaps you can clarify your configuration, requirements and issue.

Testing with REST API explorer and the table API, a PUT of yourstring into short_description works without any issues.