Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Issue with Jelly Scipt on UI Page

Cynthia19
Tera Contributor

Hello Beautiful People,

Cynthia19_0-1713394518923.png

 

 

 

I wrote a code in UI Page using Jelly Script, I have run the code, and it works but having issues. The <p> tag and </p> keeps getting inserted in the beginning and end of my text. Please find the below script which I wrote. Need help with removing those tags. What am I doing wrong with the script, I  just need to pull the text entered in the field to display without the tags

 

Cynthia19_3-1713394422444.png

Thank you very much as this

1 ACCEPTED SOLUTION

James Chun
Kilo Patron

Hi @Cynthia19,

 

Try adding the below code in line 19 of the HTML section:

field_value = field_value.replace(/&lt;(\/?)p&gt;/g, ''); 

 This should remove all the tags, but note that this may break the format depending on the HTML content.

 

Cheers

View solution in original post

2 REPLIES 2

James Chun
Kilo Patron

Hi @Cynthia19,

 

Try adding the below code in line 19 of the HTML section:

field_value = field_value.replace(/&lt;(\/?)p&gt;/g, ''); 

 This should remove all the tags, but note that this may break the format depending on the HTML content.

 

Cheers

Cynthia19
Tera Contributor

@James Chun 

 

You are a blessing sir I thank you so much for your help as I have been struggling with this.