Display Fields in kb_view

dineshgs
Kilo Contributor

How to dynamically display the field values in kb_view ? How to achieve it through UI Macros or is there any other way ?

1 ACCEPTED SOLUTION

CapaJC
ServiceNow Employee
ServiceNow Employee

It's Jelly, so you can use j2:if tags to dynamically render things based on criteria. e.g.,



<j2:if test="$[kb.topic == 'email']">
$[kb.u_email_topic_related_field.getDisplayValue()]
</j2:if>


View solution in original post

9 REPLIES 9

coolboy
Mega Expert

can you explain bit more,like on kb_view ui page we have many macros working like kb_header search,kb_affected_products,kb_feedback etc.You are saying u want to display kb_knowledge fields dynamicaly but in whcih area in kb_view ui page in article text?

this is screen shot of how we are doing it our knowledge base....


dineshgs
Kilo Contributor

usually the long description gets displayed in kb_view. I want the additional fields to get displayed dynamically as soon as the long description gets populated. I tried to display it by creating UI Macro. The code is something like this :

My new field: $[kb.u_my_field.getDisplayValue()] // displays the content of the u_my_field from the current article

Now i want to do this dynamically depending on the field that gets loaded.


dineshgs
Kilo Contributor

we are using 'kb_view_custom' UI Macro. But using this we are able to display fields statically.
we need to display fields dynamically based on topic and sub topic.


tj2
Kilo Contributor

Can anyone help with any workaround on this?