Copying html- to string field encodes characters

HD4
Kilo Expert

I have an HTML description field which I want to strip for html and copy to a pure string field.

I have already dealt with stripping the html tags, but certain characters (not tags) automatically get encoded when copying the value to the string field using a business rule. WHY?

This only occurs when done through a business rule, not when entering special characters directly into the string field.

For example:

Description (HTML) contains characters such as @ og + get encoded when copied without any modification to Symptoms (string) as below:

find_real_file.png

find_real_file.png

3 REPLIES 3

Abhinay Erra
Giga Sage

Try this in your client side code



var string= strip(g_form.getValue('description'));


function strip(html)


{


    var tmp = document.createElement("DIV");


    tmp.innerHTML = html;


    return tmp.textContent || tmp.innerText || "";


}


Thank you for your response.


That does seem to return a well formatted string including the proper characters, but I cannot rely on client side code in this case.


This has to be done in a business rule. Why does this occur?


I want to capture the html content in a field u_Html_content  (type - HTML) of an incident form to the custom table's field (u_description) which is a string field.

I am able to get the data into my custom table's field.  But the thing is..... I need to capture the exact format what ever available in incident's field--

I am already capturing its content but its in DIV format, which is not my requirement. I need the exact format

 

any idea on how to achieve this?