Regarding flow designer

venkyk1309
Tera Contributor

Hello everyone,

 

I need a description in my ritm which should same like as catalog item description. When i used dot walk for it in my flow designer i am getting the description with html tags in ritm description.

Could you please share how can i proceed with that , if script need for can you please provide the script for it.

Thanks in advance.

2 ACCEPTED SOLUTIONS

Ankur Bawiskar
Tera Patron
Tera Patron

@venkyk1309 

Catalog item description field is HTML type, RITM description field is String type

so you will have to strip the HTML tags and then add

Do this

1) create a flow variable of type String

AnkurBawiskar_1-1753449402990.png

 

AnkurBawiskar_2-1753449430645.png

 

2) then use Set Flow Variable logic and strip the HTML tags using script and set in that flow variable

AnkurBawiskar_0-1753449346371.png

var itemDescription = fd_data.trigger.request_item.description.toString();
itemDescription = itemDescription.replace(/<[^>]*>/g, '');
return itemDescription;

3) then use "Update Record" flow action and use this flow variable to set the RITM->Description

AnkurBawiskar_3-1753449589770.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

Aniket Chavan
Tera Sage
Tera Sage

Hello @venkyk1309 ,

Yeah , you can use script insted of dot walk to set the description same as Cat Item by removing the HTML tags, just use the code below for besides desc .... 

var catItem = fd_data.trigger.request_item.cat_item;
var desc = catItem.description;

// Strip HTML tags from the description
if (desc) {
    var strippedDesc = desc.replace(/<[^>]*>/g, '').trim();
    return strippedDesc;
}

return '';

AniketChavan_1-1753449673146.png

 

 

AniketChavan_0-1753449646241.png

 

Final Output:

AniketChavan_2-1753449714942.png

 

this will work just fine, I just tested the same and also let me know if you are able to  see the Screenshots or not if you face any issues, seems like there is been the issue with screenshots ....

 

 

🔹 Please mark Correct if this solves your query, and 👍 Helpful if you found the response valuable.

 

Best regards,
Aniket Chavan
🏆 ServiceNow MVP 2025 | 🌟 ServiceNow Rising Star 2024

 

View solution in original post

7 REPLIES 7

anshul_goyal
Kilo Sage

@venkyk1309,

Use below script to avoid HTML tags:

var ritm = new GlideRecord('sc_req_item');
if (ritm.get(fd_data.trigger.request_item.sys_id)) {
        var catItem = ritm.cat_item.getRefRecord(); // dot-walk to catalog item

        if (catItem && catItem.description) {
            var strippedDescription = catItem.description.replace(/<[^>]*>?/gm, ''); // Remove HTML tags
            return strippedDescription;
        }
}


Please mark my response as Accepted and Helpful for future references.

Thanks

Ankur Bawiskar
Tera Patron
Tera Patron

@venkyk1309 

Catalog item description field is HTML type, RITM description field is String type

so you will have to strip the HTML tags and then add

Do this

1) create a flow variable of type String

AnkurBawiskar_1-1753449402990.png

 

AnkurBawiskar_2-1753449430645.png

 

2) then use Set Flow Variable logic and strip the HTML tags using script and set in that flow variable

AnkurBawiskar_0-1753449346371.png

var itemDescription = fd_data.trigger.request_item.description.toString();
itemDescription = itemDescription.replace(/<[^>]*>/g, '');
return itemDescription;

3) then use "Update Record" flow action and use this flow variable to set the RITM->Description

AnkurBawiskar_3-1753449589770.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@venkyk1309 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar 
Thankyou for your response
In my case i need a catalog item description you have give description of request_item.description 
I got my solution Ankur thank you for your response that also helped me in other way 
Have a good day...!

Regards,
Venkatesh