- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2024 07:58 PM
I want to create a Business Rule that removes a role when a user's session times out.
I have created a Business Rule as follows, but the Business Rule does not execute when the user's session times out.
However, if I manually enter a value in the “Invalidated” column of the User Sessions[ sys_user_session ] table, the business rule executes.
Why are business rules not automatically executed when a user's session times out?
<Setting Business Rules>
Table: User Sessions[sys_user_session]
【When to run】
When:after
Filter Conditions:Name is not empty
Update
【Advanced】
Script : The “ invalid” column of the sys_user_session table identifies the username to which the update has been applied and contains a script to remove the role of that user.
Thank you.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2024 02:04 AM
I was able to do this by setting the table for the Business Rule to be the user login history [sys_user_login_history] table instead of the user session [sys_user_session] table.
Thank you for your help!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2024 09:12 PM
Hi there,
There are some tables where you can't run Business Rules on. If this also applies to this table, honestly don't know!
What you could think of as alternative, have a look if there are events generated. And use those events to run your logic.
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2024 09:29 PM
When you say "there are some tables where you can't run Business rules", what does that exactly mean?
You can't create a custom one, or the BR itself is not supported there. Are there any examples of such tables which you can share?
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2024 02:22 AM
I have inquired with NowSupport and they say that the user session [sys_user_session] table is the table where Business Rules can be executed.
Also, there were no events kicked when a session times out.
The “login” and “logout” events are kicked when a user logs in and logs out.
Do you see any reason why the business rules are not being executed?
Please let us know if you have an alternative solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2024 02:04 AM
I was able to do this by setting the table for the Business Rule to be the user login history [sys_user_login_history] table instead of the user session [sys_user_session] table.
Thank you for your help!