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

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>


dineshgs
Kilo Contributor

Thanks .. It worked 🙂


Not applicable

I'm hoping someone can help with the issue I'm having. I'm also trying to add fields to dynamically populate. I want to add author and topic owner group. I'm modifying the kb_article_header macro. I added the below code.

${gs.getMessage("Author")}:$[SP]$[kb.author]

It returns Author:eab0ad7a0a0a3c1f01e9a7a151e12fb8

I've changed kb.author to other possibilities but it doesn't return a value. Any ideas as to what I'm missing???


It is returning a value, just not the display value for the field. Try this instead...

kb.author.getDisplayValue() or kb.author.name


Thank you. I entered kb.author.getDisplayValue() and it returned the value I was looking for.