Get data from sys_audit_delete table.

duy nguyen1
Kilo Contributor

Hi team,
I am new to Service Now.
My current task is to get the data deleted record. I have 2 questions as follows:
I want to get data from the sys_audit_delete table, what role do I need to do that?
Can I get data from the sys_audit_delete table using API? (nice if you can attach some documentation on how to get this)

I hope to receive an answer.
Thanks & Regards,

Duy Nguyen

 
1 ACCEPTED SOLUTION

Community Alums
Not applicable

Hi @duy nguyen ,

Firstly, you would require "Admin" role to perform anything.

secondly, you can check if there are any existing ACLs on "sys_audit_delete" table, if yes then there would be roles mentioned who has what permissions, so based on that you can access.

Finally, If you have integrated servicenow with your external tool then you can get data from any table. But it's not recommended to integrate data with deleted records in ServiceNow.

Here is an example to request the deleted data : https://community.servicenow.com/community?id=community_question&sys_id=2c2107e5db98dbc01dcaf3231f96...

 

I hope i answered all of your queries, Kindly mark the applicable answer as Correct & Helpful both such that others can get help.

Thanks,
Sandeep

View solution in original post

4 REPLIES 4

Community Alums
Not applicable

Hi @duy nguyen ,

Firstly, you would require "Admin" role to perform anything.

secondly, you can check if there are any existing ACLs on "sys_audit_delete" table, if yes then there would be roles mentioned who has what permissions, so based on that you can access.

Finally, If you have integrated servicenow with your external tool then you can get data from any table. But it's not recommended to integrate data with deleted records in ServiceNow.

Here is an example to request the deleted data : https://community.servicenow.com/community?id=community_question&sys_id=2c2107e5db98dbc01dcaf3231f96...

 

I hope i answered all of your queries, Kindly mark the applicable answer as Correct & Helpful both such that others can get help.

Thanks,
Sandeep

Tony Chatfield1
Kilo Patron

Hi, as Sandeep indicated the table, access module related UI actions are restricted to ‘admin’ user

I haven’t tried to access the table via API, but see no reason why you could not use the table API to access although the need to filter for the content of the payload field based on your data requirements could make this messy and a little inefficient.
Similarly any resulting data set would be in XML format from within the payload field and would require decoding\interpretation based on the records original table.
You also need to be aware that this is not all deleted data, just records from audited tables.

Can you clarify your business use case?

duy nguyen1
Kilo Contributor

Thanks, Tony, Sandeep.

@Tony Chatfield , @Sandeep Dutta 
This is my case: Workload catalog, Workforce management, Change management, Problem management in Service Now.
I need to answer the following question for the above data sets "Find a solution to extract deleted records"
I read the docs and saw that deleted records are found in the sys_audit_delete table and I thought I would get the data from the sys_audit_delete table.
Is that true?

 

Thank,

Duy Nguyen.

Community Alums
Not applicable

Refer to the link i shared.