convert data

VSN
Tera Expert

I have created a record procedure for one of my tables called Employee.

if I submit the record procedure all the data will be loaded into the Employee Description field in the employee table.

and that the employee description field is HTML type. currently, data is displaying like 

ex: name: ABC Location:xyz age:26 blood group:o positive.

but I need data to display :

name:ABC

Location:XYZ

age:26

like this

how to covert data HTML to string type.

4 REPLIES 4

Samaksh Wani
Giga Sage
Giga Sage

You need to use :-

 

[code]

<p>name: ${variable}</p>

<p>Location: ${variable}</p>

<p>age: ${variable}</p>

[/code]

 

Plz Mark my Solution as Accept and Give me thumbs up, if you find it helpful.

 

Regards,

Samaksh

 

not working

Hello @VSN 

 

Share your code what you wrote i will help u

Community Alums
Not applicable

Hello @VSN ,

 

You will have to remove the HTML tags. Ex:

var html = "<p>This is <b>some</b> HTML content.</p>";
var plainText = html.replace(/<\/?[^>]+(>|$)/g, "");
gs.print(plainText);
 
And for line breaks in HTML, you can use the <br> tag. And in strings, use '\n'.
 
@VSN , Please mark my answer as "Accept as Solution" and "Helpfuls." If it works for you.
 
Thank you!