How to replace special character (/) with a space in Business rules
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2022 11:48 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2022 12:49 AM
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.