remove carriage return characters or extra spaces from specific table record
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2022 09:36 AM
Hi All,
In the Hardware asset table for serial number, I get the record for contains and starts with, but I don't get the record for is equal to (=).Maybe while importing some extra spaces or carriage return characters are added(after searching a lot, I got these answers and I don't know which is correct in my case). So correct me if i'm wrong.
After reimporting that record, we were able to resolve this issue. Also please help me with exact script for this issue to avoid getting such types of inputs.
Please help me to understand this situation and selecting script.
Note : i have to create script for workflow as well as before condition transform script.
Thanks in advance.
Tanmay Mangaonkar
- Labels:
-
Enterprise Asset Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2022 09:46 AM
Hi All,
I have sorted out some scripts without knowing my situation.
After knowing the situation ill implement.
1)smo = smo.replace(/<br\/>/g,'');
2)smo= smo.replace(/(<|<)br \s*\/*(>|>)/gi,'');
3)smo = smo.replace('/\r\n'," ");
4)smo = smo.replace(/CN=/g,"");
5)smo = smo.replace(/\s+/g,"");
6)smo = smo.replaceAll("\r","");
Thanks in advance
Best regards,
Tanmay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2022 09:51 AM
Hi Experts,
Please help me with this situation.
Thanks & Regards,
Tanmay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2022 10:38 AM
Hi Tanmay,
If the issue is about leading spaces. you can write like below in transform map or background scripts to modify the existing records.
smo = smo.toString().trim();
Definitely, it is not good idea to remove spaces or hyphens in between the serial numbers, as in certain cases they might be valid. It is good idea to get them corrected over excel and reload them.
Hope this helps.
Regards
Saranesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2022 07:42 AM
Hi Saranesh,
Thanks for your quick response.
I'm not sure if these are empty spaces or not. Earlier, we raised one HI ticket and i got to know from my teammates that the servicenow support team were able to see =ABCD1234" such types of extra quotes in the serial number for us, it was =ABCD1234 only. So the trim is not working?
Thanks & regards,
Tanmay