- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2017 06:58 AM
Good morning,
Is there a way to make locations inactive in ServiceNow? We imported current(updated) locations from AD and users now have the correct locations within their company. However, the "old" locatoins are still available in the drop down menu. We do not want users to see these depricated locations.
Thank you!
Heather
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2017 07:03 AM
Hi Heather,
Here's how I would handle this - without deleting any of the previous records, because deleting can cause issues with broken references.
- Create a new field on the location (cmn_location) called Active (u_active) and make it a true/false field.
- Make the locations you want to appear active (true) and those that you don't, leave unchecked.
- Create a before/query business rule that automatically filters for the active records only. Use the "user query" business rule as an example (substitute YOURINSTANCE for your instance name in the following URL
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2017 12:59 PM
Thank you Chuck! I will take a look at this episode-I just learned about reference qualifiers as well(when I found one in an unexpected place!) I will try your first solution, as I have a few locations to handle.
Regards,
Heather

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2017 09:29 PM
You are welcome Heather. If I have answered your question, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.
If you are viewing this from the community inbox you will not see the correct answer button. If so, please review How to Mark Answers Correct From Inbox View.
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2017 08:07 AM
Chuck,
I am having a bit of trouble with the business rule-I have used the user query as an example, but I believe my condition is incorrect for location, and my script is possibly incorrect(I am new to scripting).
The condition I am using is:
gs.getSession().isInteractive() && !gs.hasRole("admin") && !gs.hasRole("user_create")
My script is this:
current.addActiveQuery();
Can you advise on how I would change this script?
Thanks!
Heather

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2017 09:32 AM
Hi Heather,
the addActiveQuery() method only works if there is a field called 'active'. Since you added it, the field is called u_active. Instead, use this query
current.addQuery('u_active', true);
(FWIW, I do this kind of thing all the time.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2017 12:57 PM
Thank you Cheyenne, this would work well for some of my smaller companies!