pratik_kumar
Giga Expert

Hi Prajwal ,



You can create a new field on you table and copy the HTML text to that filed using the below script.


You have to run this as a background script.



var so=new GlideRecord('-----------------'); //your table name


so.addNotNullQuery('-------------------'); //HTML field name or add a query condition as per your requirement.


so.query();


while(so.next())


{


var a= so.unit_description.getXHTMLValue();


a= a.replace(/&(lt|gt);/g, function (strMatch, p1){


return (p1 == "lt")? "<" : ">";


});


var b = a.replace(/<\/?[^>]+(>|$)/g, "");


so.setDisplayValue('----------------------',b); // New field name


so.update();


}




- Please like or mark as correct/helpful as you see fit.


View solution in original post