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.

SOW: How custom fields to "Secondary fields" of knowledge article view?

VanGoghJoe1
Tera Contributor

In SOW, I'd like to add some custom fields to the bottom of the details section of the main knowledge article view (the "fancy" one that shows the rating and feedback options, etc).


Judging from the UIB documentation for the Knowledge Content component, one way to would be to display them as "Secondary fields", but how do I add my fields to that list of Secondary fields?  Specifically, is that  a configuration option somewhere?  It appears to come from the "Get article details" data resource, but I can't tell quite how that is pulling its data or how it's defined.  

1 REPLY 1

Anupam1
Kilo Guru

Hi @VanGoghJoe1 

To add custom fields to the “Secondary fields” section in the Knowledge Content component in Service Operations Workspace (SOW), you need to modify the Get article details data resource and extend its output to include your custom fields. Then, configure the component to display them.

How Secondary Fields Work in SOW Knowledge Content:

The “fancy” article view in SOW uses the Knowledge Content UIB component, which supports a secondaryFields array. These fields are rendered in the article header or footer, depending on configuration.

The data for these fields typically comes from the Get article details data resource, which is a composite resource combining:

  • Article metadata (title, rating, author, etc.)
  • Configuration flags (showHelpful, showRating, etc.)
  • Custom logic via evaluateProperty() or IF() expressions

Steps to Add Custom Fields:

  1. Extend the Data Resource
  • Open UI Builder and locate the Get article details data resource.
  • Switch to Composite view or JSON view.
  • Add your custom field(s) to the articleDetails.articleInfo.secondaryFields array.

Example:

{

  "column": "customField1",

  "icon": "info-outline",

  "screenReaderText": "Custom field: {0}",

  "text": "{{data.articleDetails.articleInfo.customField1}}",

  "type": "custom"

}

 

Make sure customField1 is available in the articleInfo object. If not, you’ll need to:

  • Extend the server-side script or data source that populates articleInfo.
  • Or use a client-side transformer to inject it.
  •  
  • 2. Expose the Field in the Component
  • In the Knowledge Content component, go to Component visibility settings.
  • Under Secondary fields, ensure your new field is listed and toggled on.
  • You may need to use a dynamic expression like:

IF(data.articleDetails.articleInfo.customField1, true, false)

 

 3. Ensure Field Availability

  • If your field is stored in the KB article record (e.g., kb_knowledge.custom_field_1), make sure the GlideRecord query or Script Include backing the data resource includes it.
  • For dynamic fields (e.g., calculated values), use a transformer or client script to inject them into articleInfo.

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

 

Thanks,

Anupam.