How to replace special character in string field

Sagar S
Tera Contributor

Hi,

We have HTML field called "short description" and string field called "exception short description", we are copying the values from html field to string field by removing the html tags. now we are facing an issue that special characters is also copying from html field to string field. We would need to remove the special character from the string field and the special character should not copy from html field to string field.

 

Regards,

Sagar

1 ACCEPTED SOLUTION

Hi @Sagar S ,

In which script you are populating it.

I have created business rule with below script

AnandKumarP_0-1698925636944.png

 

AnandKumarP_1-1698925719698.png


Thanks,

Anand

View solution in original post

15 REPLIES 15

Community Alums
Not applicable

Hi Team,

I am trying to replace 
the special characters should be replaced with their equivalent:

ä ---> a
ë ---> e
ï ---> i
ö ---> o
ü ---> u
ÿ ---> y

I am trying like below in business rule 

 case "u_planned_productive":
                case "u_planned_outofservice":
                case "u_termination_pending": {
                    var keyCapry = capry_util.serviceNowToCapryFieldTransform(key);
                    var nonEngV = value.replace(/[^\x20-\x7E]+/g);
                   
                    jsonObj[keyCapry] = nonEngV;
                    break;
                }
         Note : .replace(/[^\x20-\x7E]+/g);   this one escaping the nonenglish letter for example if i will give input like Mühlhäuser   -> output i am getting Mhlhuser like this 
Actually i need output like Muhlhauser
 
Please help me if anyone know the solution 
Thanks & Regards
Bandi