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.

How to add javascript in Knowledge articles(article body)

Rajasekhar Meka
Kilo Contributor

Hi,

 

I am trying to use the trial version of Orlando, to provide integration of directly publishing articles to Knowledge management from my product. I am trying to add javascript in Article body(i have changed the field type from Translated_html to HTML, as suggested in one of your articles) but when I try to add it from UI, in the article body, the code editor is stripping off the script tags inside the body content.

Is it possible to add javascript inside a knowledge article body? If so, do I have to enable any settings?

please suggest me in the appropriate direction for enabling this option.

 

Thanks,

Rajasekhar

5 REPLIES 5

sachin_namjoshi
Kilo Patron
Kilo Patron

You can create a new field with the type of "script", and place the javascript in that field.  The KB article body field is a text field.  You could put the javascript in the body field, but you will not have the formatting abilities.

 

Regards,

Sachin

Hi sachin,

Thanks for your reply. I have added a script field in article and added an alert script. I saved the article and published it. but the javascript i added is not running. Am i missing something?

 

find_real_file.png 

Did this ever get resolved or has anyone else had any success? 

Is there an update? I do not see an option to create a new field anywhere in the KB article. I have two types HTML and Wiki when creating an article. Any thoughts?