- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-15-2024 08:51 AM
How can I have a published report filtered to only display data for the logged-in user's location?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-16-2024 04:31 AM
Dynamic Filters are easy to create yourself:
https://www.servicenow.com/community/developer-articles/create-your-own-dynamic-filters/ta-p/2321052
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-15-2024 09:22 AM - edited ‎12-15-2024 09:23 AM
Create a new Data base view using your desired table
In your database table create a before query business this will display only those data according to logged in user location
When to Run - Before Query
Scripts -
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
var current_user = gs.getUserID();
var usr = new GlideRecord('sys_user');
usr.addQuery('sys_id', current_user);
usr.query();
if (usr.next()) {
current.addQuery('location=' + usr.location);
}
})(current, previous);
Please mark my answer correct/helpful if it resolved your query

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-15-2024 09:31 AM
Does the table the report is based on have a field which relates to the current logged in user? If so, you can use a dynamic filter within the report's query.
An example for the incident table would be a query of
Caller .is (dynamic). Me
"Me" being a dynamic filter option
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-15-2024 10:04 AM
I'm just looking at incident table for now, but there's no dynamic operator available for the Location field. That's really what I want: "Location is dynamic Me."

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-16-2024 04:31 AM
Dynamic Filters are easy to create yourself:
https://www.servicenow.com/community/developer-articles/create-your-own-dynamic-filters/ta-p/2321052