What triggers the [sys_updated_on] field to get updated?

Korynn
Tera Contributor

I need to know what specifically triggers the [sys_udpated_on] field to get updated (I know  EVERY type of change/modification in ServiceNow (SN) does not trigger it to get updated).  Long story short: We have an external reporting system that we use for advanced reporting/queries.  The updates to that external reporting system are done on an incremental basis.  The incremental updates from (SN) are based on the [sys_updated_on] field.  Therefore, I need to know what types of updates will/will not make it into our external reporting system.

1 ACCEPTED SOLUTION

Gowrisankar Sat
Tera Guru

Hi,

sys_updated_on column on every table is defined by default in the Database of ServiceNow.

- These gets changed whenever there is a manual change in the record.

- Any business rule/script include/workflow/server side script updating the records will update this value.

- This doesn't get updated when there there is this code: autoSysFields(false); in the server side script.

- When you have a code which update sys_updated_on field, this doesn't get updated.

- This will not change sys_updated_on when you save a form, update a record through script but there are no changes in the record.

Check out these community articles for reference:

https://community.servicenow.com/community?id=community_question&sys_id=fafac7addb5cdbc01dcaf3231f96...

https://community.servicenow.com/community?id=community_question&sys_id=d0064761db1cdbc01dcaf3231f96...

https://community.servicenow.com/community?id=community_question&sys_id=58819f2ddbdcdbc01dcaf3231f96...

View solution in original post

9 REPLIES 9

Community Alums
Not applicable

Hi,

 

As "sys_updated_on" is the timestamp for system updates you will get almost all data. But you should check in servicenow studio for this code:

autoSysFields(false); // this stops update of sys_updated_by, sys_updated_on, sys_mod_count, sys_created_by, and sys_created_on fields

Whatever script has this line present in it will not show up on your report.

 

Please mark as CORRECT if this solves your query

Thanks,

DR

DirkRedeker
Mega Sage

Hi

This is a system field, which is built-in for each table in ServiceNow.

The value will be updated automatically (by magic in the background) any time, the record is updated.

I do not know any situation, when this field is not updated, but some field value changes on the record.

Let me know, if that answers your question and mark my answer as correct/helpful, please.

BR

Dirk 

Gowrisankar Sat
Tera Guru

Hi,

sys_updated_on column on every table is defined by default in the Database of ServiceNow.

- These gets changed whenever there is a manual change in the record.

- Any business rule/script include/workflow/server side script updating the records will update this value.

- This doesn't get updated when there there is this code: autoSysFields(false); in the server side script.

- When you have a code which update sys_updated_on field, this doesn't get updated.

- This will not change sys_updated_on when you save a form, update a record through script but there are no changes in the record.

Check out these community articles for reference:

https://community.servicenow.com/community?id=community_question&sys_id=fafac7addb5cdbc01dcaf3231f96...

https://community.servicenow.com/community?id=community_question&sys_id=d0064761db1cdbc01dcaf3231f96...

https://community.servicenow.com/community?id=community_question&sys_id=58819f2ddbdcdbc01dcaf3231f96...

Hi Gowrisankar

Thanks for the "autoSysFields()" function info.

Do you know, how long this setting is valid, let's say it was set:

a) in a user's session by a Business Rule.

b) in a business rule fired by a REST API call

c) in a scheduled job

Thanks a lot 

BR

Dirk