Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

KB Article to show Author instead of Revised by details on kb_view page

Naveen87
Tera Guru

Hello Developers,

 

Looks like OOB KB Article shows the latest revised by name at kb_view for article.

Is there any option to show Author name instead of Revised by?

Naveen87_0-1738318409955.png

 

1 ACCEPTED SOLUTION

Naveen87
Tera Guru

It was helpful but not exactly what I'm looking for.

Anyways I have got my code of lines to remove revised & add Author or both can be kept.

<div id="articleAuthor" class="snc-article-footer-metadata-published" style="display: block;padding-top: 5px">
    <j:choose>
        <j:when test="${kbViewInfo.externalArticle}"> 
            <g:evaluate var="jvar_external_content">
                gs.getMessage(gs.getProperty('sn_km_intg.glide.knowman.external.ui_label_for_external_content', 'External Content'))
            </g:evaluate>
            ${jvar_external_content}
        </j:when>
        <j:otherwise>
            ${revisionString}  <!-- Shows the Revised by details -->
        </j:otherwise>
    </j:choose>
</div>

<!-- New Author Display Section -->
<div id="articleAuthorName" class="snc-article-footer-metadata-published">
    <g:evaluate var="jvar_author_name">
        gs.getMessage("Author: {0}", knowledgeRecord.sys_created_by);
    </g:evaluate>
    ${jvar_author_name}
</div>

 

View solution in original post

2 REPLIES 2

JerryJ071847183
Tera Sage

The below article shows how changes were done for kb_view in UI page to make some changes related to author,

I believe your revision code will be on the same page .

 

Have a look at it for reference.

 

LINK

 

I hope this helps.

Naveen87
Tera Guru

It was helpful but not exactly what I'm looking for.

Anyways I have got my code of lines to remove revised & add Author or both can be kept.

<div id="articleAuthor" class="snc-article-footer-metadata-published" style="display: block;padding-top: 5px">
    <j:choose>
        <j:when test="${kbViewInfo.externalArticle}"> 
            <g:evaluate var="jvar_external_content">
                gs.getMessage(gs.getProperty('sn_km_intg.glide.knowman.external.ui_label_for_external_content', 'External Content'))
            </g:evaluate>
            ${jvar_external_content}
        </j:when>
        <j:otherwise>
            ${revisionString}  <!-- Shows the Revised by details -->
        </j:otherwise>
    </j:choose>
</div>

<!-- New Author Display Section -->
<div id="articleAuthorName" class="snc-article-footer-metadata-published">
    <g:evaluate var="jvar_author_name">
        gs.getMessage("Author: {0}", knowledgeRecord.sys_created_by);
    </g:evaluate>
    ${jvar_author_name}
</div>