Track Activity Only When Clicking "Answer" Button on the Answer Screen

Khalid9030
Tera Contributor

Hi Everyone,

I have a question regarding how activity entries are recorded on the Answer screen in ServiceNow.

Currently, there are two buttons available:

  • Update

  • Answer 

Both buttons are updating the form, which causes entries to appear in the Activity section. However, my requirement is:

When the Answer button is clicked → The update should be recorded in the Activity field
When the Update button is clicked → No entry should be recorded in the Activity field

Is there a way to configure or customize this behavior so only "Answer" action updates are tracked in the Activity section, while ignoring updates made using the "Update" button?

If anyone has implemented something similar or can suggest an approach

 

Note : both buttons are custom made. 

Thanks in advance for your help!

2 REPLIES 2

Connectmustaq
Mega Guru

Assalamualaikum @Khalid9030 ,

 

To meet the requirement where only the "Answer" button updates create entries in the Activity section, while updates from the "Update" button do not, you can implement a flag-based control mechanism to distinguish between the two actions and selectively log activity entries.

Suggested Approach:

1. Introduce a Flag Field

Add a temporary flag field (e.g., u_log_activity boolean) on the record to indicate whether the current update should be recorded in the Activity section.

2. Modify Client-side Button Scripts

  • In the "Answer" button script, before submitting the form or saving the record, set the flag to true.

  • In the "Update" button script, set the flag to false.

Example for "Answer" button:

g_form.setValue('u_log_activity', 'true');
g_form.save(); // or submit

 

For "Update" button:

 

g_form.setValue('u_log_activity', 'false');
g_form.save(); // or submit

 

3. Customize Business Rules or Script Includes handling Activity Logging

  • On the server side, create or modify a Business Rule that runs on update.

  • Inside the Business Rule, check the value of the u_log_activity flag.

  • If true, allow default activity logging or explicitly write journal entries.

  • If false, prevent adding any journal entries or activity records.

Example scratch (pseudo-code) for Business Rule:

if (current.u_log_activity == 'false') {
// Suppress activity log creation, for example by:
// - Skipping journal entry additions
// - Setting comments or work notes fields to not log
// - Returning early from the script
return;
}
// Proceed with normal activity logging if u_log_activity is true

 

4. Clear the Flag After Each Operation

After the record is saved, reset or clear the u_log_activity flag (either in the Business Rule or via a setTimeout client script) to avoid it persisting unintentionally for future updates.

Summary

By using a temporary flag set by button actions and checking it in your server-side logging logic, you can precisely control which button updates trigger activity entries.

 

If it is helpful, please hit the thumbs button please mark the answer as correct based on the impact!!

 

 

Kind Regards,

Shaik Mohammed Mustaq

@Connectmustaq 
Thanks for the response. I have seen a similar explanation through AI, but I wanted to check — have you personally implemented this kind of scenario before? Any practical experience or examples would be really helpful.