Field Changes in Activity Stream in Portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2025 07:22 AM
Hi Team, is it possible to show the Field Changes in the Activity Stream of Portal?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2025 07:33 AM
Hi @debendudas
ServiceNow doesn’t provide a default option to show field changes in the Activity Stream, you can customize this functionality using widgets and the sys_audit table. This method allows you to display field changes in the Activity Stream or another relevant part of your portal.
I hope my answer helps you to resolve your issue, if yes please mark my answer helpful and correct.
thank you
Rajesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2025 07:35 AM
Thanks for your replying Rajesh.
Do you have any sample script or example?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2025 07:52 AM
hi @debendudas
You can create new 'widget' and use bellow server script & client script:
server script :
var gr = new GlideRecord('sys_audit');
gr.addQuery('document_key', current.sys_id); // For a specific record
gr.orderByDesc('sys_created_on'); // Sort by most recent changes
gr.query();
var changes = [];
while (gr.next()) {
var change = {
fieldName: gr.fieldname,
oldValue: gr.old_value,
newValue: gr.new_value,
timestamp: gr.sys_created_on
};
changes.push(change);
}
data.fieldChanges = changes; // Pass the changes to the widget client
client script code:
// Display the field changes in the widget template
data.fieldChanges.forEach(function(change) {
var changeText = change.fieldName + ' changed from ' + change.oldValue + ' to ' + change.newValue;
// Append changeText to your HTML or Activity Stream view
});
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2025 07:34 AM
Hi! @debendudas, By default, Field Changes (also known as audit records) in ServiceNow are not shown on the portal's activity stream (e.g., in Service Portal or Employee Center). Only Comments and Work Notes are typically included.
However, yes—it is possible to show field changes in the portal activity stream by customizing the widget logic.
Here’s how you can do it:
✅ Option 1: Customize the Ticket Conversations or Activity Stream widget
Navigate to the Service Portal > Widgets.
Look for the widget used for showing activities (e.g., Ticket Conversations, Activity Stream, or a custom one).
Edit the widget's server script to include sys_audit records.
Merge the audit records into the same data array as comments/work notes with proper formatting.
✅ Option 2: Create a custom script in a widget or portal page
Fetch and display data from the sys_audit table filtered by:
documentkey = the record sys_id
Fields of interest (like state, priority, assigned_to, etc.)
Format the display for readability and show it alongside comments/work notes.
Key Table Info:
Table: sys_audit
Fields: fieldname, oldvalue, newvalue, sys_created_on, sys_created_by, documentkey
If my response helped please mark it correct and close the thread so that it benefits future readers.