- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2016 03:38 PM
Hi folks!
We have a business need to display records based on physical locations (cmn_locations) in addition to the Assigned To/Group fields. For example, a Facility Engineer will need to see Work Orders assigned to themselves along with all other Work Orders related to the location(s) they cover.
I am trying to find a way to leverage the User Location Coverage (sys_user_covers_location) table to return the locations and then filter a report that way. Is anyone aware of a way of leveraging a JavaScript query in the report builder for locations? What I was thinking is I could use JavaScript to return the location sys_ids, similar to a breadcrumb query, ex:
location=1b6b156013335e005c45b53a6144b080^ORlocation=d647f9aa13b0a24024d67e276144b04c^ORlocation=1154e9e013335e005c45b53a6144b064
Or is there a way to leverage the UI to select the Locations Covered table (screenshot below)?
Thanks in advance!
David
Solved! Go to Solution.
- Labels:
-
Dashboard
-
Performance Analytics
-
Reporting
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2016 04:28 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2016 03:54 PM
Hi David,
You are right!!, You can call a script include function from the filter with something like below and have that function returning sys_ids.
javascript: new ScriptInludeName().functionName()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2016 03:54 PM
Can you please let me know what table are you querying. I am not much into Facilities Management. Looks like you question is related to that.
OR
You can also use the technique below to use a dynamic value in the report condition fields.
Set Default Value for Reference Fields - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2016 04:28 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2016 06:55 PM
Srinivas,
Thank you for the details and screenshots, much appreciated. My script is working as expected and has been tested in a fix script. The issue I seem to have now is I do not have the 'IN' operator available to select in the Filter Condition builder. I'm using some Googlefoo to try to figure out why it's missing...
Thanks,
David