- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2024 05:19 AM
Need to send the catalog item description from sctask table,that is being sent as below but we need to send without HTML tags i.e plain text
"cat_item.description": "<p>Review has been configured.</p>",
Need to send above as
"cat_item.description": "Review has been configured.",
few other it is going as below can we modify it text only
"cat_item.description": "<p>Request account access for a system user. <a title=\"Click here\" href=\"https://pages.servicenow.com/download/attachments/280699946/vcb.xlsm\" target=\"_blank\" rel=\"noopener noreferrer nofollow\">Click here</a><span style=\"background-color: rgb(var(--sn-tinymce_content-background,var(--now-form-field--background-color,var(--now-color_background--primary,var(--now-color--neutral-0,255,255,255))))); color: rgb(var(--sn-tinymce_content-text,var(--now-form-field--color,var(--now-color_text--primary,var(--now-color--neutral-18,22,27,28)))));\"> to download the template.</span></p>",
as
"cat_item.description": "Request account access for a user. to download the template.",
Do we have any OOTB method to convert this ?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2024 05:43 AM
Hi @Mudugal Akhil ,
You can refer the below article to add hyperlink in description,
if you want to remove p tag then you can refer the below article,
write after insert BR with reference of below article,
Please mark this comment as Correct Answer/Helpful if it helped you.
Regards,
Swathi Sarang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2024 05:43 AM
Hi @Mudugal Akhil ,
You can refer the below article to add hyperlink in description,
if you want to remove p tag then you can refer the below article,
write after insert BR with reference of below article,
Please mark this comment as Correct Answer/Helpful if it helped you.
Regards,
Swathi Sarang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2024 11:45 PM - edited 02-28-2024 01:40 AM
Hi @swathisarang98
Thanks for the reply .
I have tried your workaround it is working.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2024 05:48 AM
Hi @Mudugal Akhil
Without reviewing your entire API I'm taking a shot in the dark... Try something like this.
var catdescription = "cat_item.description": "<p> Review has been configured.</p>"
var plaintext = catdescription.replace(/<[^>]+>/g, '');
console.log(plaintext);
Please mark as helpful or if its resolved the issue, CORRECT!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2024 01:40 AM
Hi @Andrew_TND
Thanks for the reply .
I have tried your workaround it is working.
Thanks