Using templates for Knowledge Articles

Presiyan Penkov
Kilo Explorer

I'm trying to create a Template to be applied to the Knowledge Article form in Istanbul. All is fine until I try to set the Knowledge Base and the Category in the same template - when applied I get a message saying that Category cannot be set.

I realise this is due to the reference qualifier on the Category field and because Knowlege Base needs to be set first since Category is dependent on that. Is anyone aware of any way to set both from a template?

10 REPLIES 10

brianf
Tera Contributor

I think you may have an issue if you cannot see the master category or you have done a customization that is interfering with the function.  



While kb_category is the table that holds the categories, I cannot see the field Category (kb_category) when I build a template, but I can see both Category and Master Category.



Since the template is based on the form, maybe the issue is in the form.   Have the article form use Master Category instead of Category (kb_category).



But, I'll admit, I kinda shooting in the dark here.



b


I cannot see Master Category in my fresh OOB personal dev either...


brianf
Tera Contributor

Hi, so one of our devs created our Master Category name...   which is really just Category (kb_category). Sorry for any confusion our customized name caused.



Regardless you should be about to pull up the template without an error.   The only thing I can think of at this point, other than starting a Hi Ticket, is to maybe move the Category field to the bottom of the template, like on my template. Because they are one after the other, maybe the category is returning before the knowledge base.


SusanWinKY
Kilo Sage

Hi Presiyan,



Were you able to get Category to work in your Knowledge Article templates?   We're having the same issue.   I've submitted a ticket with HI but thought I'd check with you, too.   Thanks!



Susan Williams, Lexmark

Smit_Patel
ServiceNow Employee
ServiceNow Employee

The category field which is read-only by design until Knowledge Base field is populated according to OOB client script "Enable or disable form fields" then If they apply a template to the knowledge article page it shows a conflict on the category field and it remains blank while all the other fields are populated correctly.




As a workaround:




Go to client scripts on the kb_knowledge table


Find the "Enable or disable form fields" client script


Go to line 5 where it has g_form.setReadOnly("kb_category", true);


In that line please change the choice from true to false.


Create a knowledge article and apply your template you will see the category field is populated.



Hope this helps If it does please mark it as a correct answer to help others