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.

How to Rename the "Activities" / "Audit Trail" title to display "System" instead of the username.

Leo Zhao
Tera Contributor

How to Rename the "Activities" / "Audit Trail" title to display "System" instead of the username.

 

LeoZhao_0-1761028017107.png

 

Thanks 

 

5 REPLIES 5

GlideFather
Tera Patron

Hi @Leo Zhao,

 

the purpose of this value is to identify who performed such an action.

 

Example: Abel Tutor created an incident, so you see their names together with the values inserted. David Loo commented and resolved on that incident so it's associated to their name.. as David resolved the incident and nothing happened for a week, the incident is automatically closed, and it was done automatically so it says "System".

 

Does this make any sense? It's not possible to rename this, you would have to relabel all the users to System.

 

What is your motivation behind this? 

_____
This reply is 100 % GlideFather and 0 % AI

Thank you for your reply.

Here's the situation: for instance, in an approval workflow, after A completes the approval, the data is updated. However, the current audit trail shows the name of the approver A. What I want to achieve is to display "System" instead of A's name. 

 

Thanks.

MaxMixali
Kilo Sage

How to Rename the "Activities" / "Audit Trail" title to display "System" instead of the username
==============================================================================================

In ServiceNow, the “Activities” (or Audit Trail) section automatically displays the name of the user who performed an action (e.g., “Updated by John Doe”).
If you want to rename or override that display name — for instance, to always show “System” instead of the real username — here are several approaches depending on the use case.

----------------------------------------------------------------------------------------------

Option 1: Update via Business Rule (Best Practice for automated updates)
------------------------------------------------------------------------
If you have system-generated updates (via script, flow, or integration) and want the activity log to show “System” instead of the integration user or admin account:

1. Go to System Definition → Business Rules.
2. Click New.
3. Configure:
- Table: The table where you want this to apply (e.g., incident, change_request, etc.).
- When: Before
- Insert/Update: Checked
4. Add this script:

(function executeRule(current, previous /*null when async*/) {
if (gs.getUserName() == 'integration_user' || gs.getUserName() == 'admin') {
current.sys_updated_by = 'system';
}
})(current, previous);

Result: The Activity formatter will display "System" instead of the actual user.

----------------------------------------------------------------------------------------------

Option 2: UI Policy or Client Display Script (for UI-only override)
-------------------------------------------------------------------
If you want to only change how the name appears visually (not in the database):

1. Add a Display Business Rule or Client Script on the form.
2. Example script:

function onLoad() {
var elements = document.querySelectorAll('.activity_author');
elements.forEach(function(el) {
if (el.innerText && el.innerText.trim() !== 'System') {
el.innerText = 'System';
}
});
}

⚠️ This only changes the label in the UI, not the actual audit record.

----------------------------------------------------------------------------------------------

Option 3: Modify sys_update_name display for system updates
-----------------------------------------------------------
If you are doing automated updates via background scripts or integrations:
- Instead of using gs.getUserID(), set:

gs.getSession().putProperty('user_id', 'system');

- Or directly set:

current.setWorkflow(false);
current.sys_updated_by = 'system';
current.update();

----------------------------------------------------------------------------------------------

Option 4: Configure “System Updates” user
-----------------------------------------
If you want all system or integration actions to appear as “System”:

1. Create or use a user record named “System” (username = “system”).
2. Configure all background jobs, imports, or integrations to run as that user.
- Example: In Flow Designer → “Run as user” → choose System.

----------------------------------------------------------------------------------------------

Summary
-------
| Use Case | Recommended Solution | Effect |
|------------------------------------|-------------------------------------------------|--------------------------------|
| Automated updates (integration) | Business Rule updating sys_updated_by | Changes actual activity log |
| Cosmetic UI rename | Client script altering text in DOM | Display only |
| Flows / background scripts | Run as “System” user | Clean audit |
| Consistent system ownership | Dedicated “System” user for all jobs | Clean separation of updates |

----------------------------------------------------------------------------------------------

By implementing one of these approaches, you can standardize your activity log entries to show “System” rather than an individual user, improving clarity for automation and system-generated actions.

please not again @MaxMixali....

 

can you please share a screenshot or anything that motivates you sharing this?

 

The requirement is not possible to achieve. Please stop posting content by generative AI without any validation... 🤦🏻‍♂️

_____
This reply is 100 % GlideFather and 0 % AI