Record producer

ADJARATOUT
Tera Contributor

Hello, I'm new to ServiceNow and I'm trying to set up a Record Producer. However, I'm facing an issue with the Description field. When I submit an incident, the text in this field contains HTML tags. The variable type is set to HTML, and it's a simple variable.

Could you help me please?

2 REPLIES 2

Ankur Bawiskar
Tera Patron
Tera Patron

@ADJARATOUT 

that's OOTB behavior.

Variable of type HTML will contain HTML tags and if you map it with String field on INC then tags will be seen.

you can use record producer script to strip the HTML tags and then set the value

something like this in record producer script and don't map the field using Map to Field feature

current.description = producer.variableName.toString().replace(/<[^>]*>/g, '');

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

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @ADJARATOUT 

This is the out-of-the-box (OOTB) behavior — or you could say it’s the expected behavior.
You’ll need to convert it, as Ankur mentioned.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************