- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-13-2017 06:10 AM
Hello friends!
I am making an Event Management application that measures temperatures in a fridge and creates Events whenever the temperature is too high.
Furthermore if the high temperature persists then I proceed to create Alerts and Incidents.
I see that the Table Cleaner automatically clears out closed Alerts after 90 dates, but as far as I can tell there's no clean up for the Event table. Now my application won't create too many events, but over the years it will grow indefinitely and no one likes to deal with an unmanageable table.
So even if ServiceNow can scale, what's the best practice for deleting records in the Event table over time? Would it be something like a background script, examples in point 4 of Deletion methods and Delete scheduled Events? And if I want to save the table history for statistic over the years how would I do that?
Thanks in advance and best regards,
Edvarda Eriksen
Solved! Go to Solution.
- Labels:
-
Best Practices
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-13-2017 06:14 AM
Hi Edvarda,
The nice thing about cloud services is that you generally don't need to worry about storage. We have customers that are generating 10s of thousands of incidents a day. It sounds like your fridge won't be near that amount of traffic, so in general, I wouldn't worry about it.
To answer some of your questions:
You COULD delete the data after 1 year (or whatever you chose - I recommend using a property here.) If you delete a record, the history is gone as well (since there's no record to attach the history to)
You could also look at archiving of old data. http://wiki.servicenow.com/index.php?title=Archiving_Data

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-13-2017 06:14 AM
Hi Edvarda,
The nice thing about cloud services is that you generally don't need to worry about storage. We have customers that are generating 10s of thousands of incidents a day. It sounds like your fridge won't be near that amount of traffic, so in general, I wouldn't worry about it.
To answer some of your questions:
You COULD delete the data after 1 year (or whatever you chose - I recommend using a property here.) If you delete a record, the history is gone as well (since there's no record to attach the history to)
You could also look at archiving of old data. http://wiki.servicenow.com/index.php?title=Archiving_Data
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-13-2017 06:32 AM
Hi Chuck,
thank you so much for the swift and clear answer! You are correct in the fact that I my application will not be dealing with that much traffic yet, so it's good to know it's nothing to worry about for now.
That being said, the customer I'm working for is considering using this application for all their stores in the long run. With the amount of stores they have, that would mean around 60 000 measurements per 15 minutes in total, where every measurement that is above a predefined threshold will be turned into an Event.
So from a future development perspective, I'm assuming we would need some storage management at that point?
Best regards,
Edvarda Eriksen

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-13-2017 06:33 AM
It's always good to think about the future and what the potential load could be.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-16-2017 11:55 PM
The Event [em_event] table has a table rotation policy applied to it that automatically removes records 7 days after being inserted into the table. You can modify this to store events longer or shorter as needed.
Navigate to System Definition > Table Rotations and then search for the em_event table to view the properties.