- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-19-2019 11:06 AM
In the Citations table, citation names sometimes contain characters/symbols that are unreadable by JavaScript and it's causing my script that works otherwise not to work. To test this I would copy a query from the citation table where the name had a special character/symbol in it - something like this query 'name=Annex A: § CLD.12.1.5 Table: Cloud service provider' - and I would only query for those citations in my GlideRecord query. It would return a row count of zero. If I modified the query where name ends with 'CLD.12.1.5 Table: Cloud service provider' it would find the two records.
I've looked up the trim function but I don't think that will work here. I need a way to remove the characters/symbols that JavaScript cannot read.
Some examples of these characters are the paragraph symbol shown here:
And whatever this symbol is shown here:
Solved! Go to Solution.
- Labels:
-
Policy and Compliance Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-19-2019 11:20 AM
You could write a regular expression that filters out any thing that isn't a letter, number or period.
var regex = /[^A-Za-z0-9\.]/
var name = gr.name
name.replace(regex, "")
This would replace any character that isn't a letter, number or period with "".

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-19-2019 11:20 AM
You could write a regular expression that filters out any thing that isn't a letter, number or period.
var regex = /[^A-Za-z0-9\.]/
var name = gr.name
name.replace(regex, "")
This would replace any character that isn't a letter, number or period with "".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-19-2019 02:17 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-19-2019 05:39 PM
Correct you'd also have to escape it with a backslash.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-19-2019 07:24 PM