- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-25-2017 03:55 AM
Hi All,
I've added a couple of simple list widgets to our portal, however I want to filter these by the company that the logged in user is part of.
I know if I wanted to filter the logs by the logged in user I could run a filter with opened by > is (dynamic) > ME, I'm just not cure how to do something similar for company as there is now is (dynamic option).
Any help is greatly appreciated.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-25-2017 04:29 AM
Hi Sam,
You can use javascript:gs.getUser().getCompanyID() condition in your filter. Below screen shot for your reference.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-25-2017 04:29 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-25-2017 05:14 AM
Hi Hari,
Thanks for the above, how would this need to be for an encoded query string so I can use it on the widget?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-25-2017 05:23 AM
To specify a Dynamic Filter, the easiest way is to capture the encoded query string for your filter using this wiki article: Encoded Query Strings - ServiceNow Wiki. Then paste that filter string into the edit panel of the widget in the Service Portal Designer.
You can also edit the widget by navigating to the Service Portal page the widget is on, CTRL+Clicking the widget, and then selecting Instance Options from the context menu.
The page can technically be any page with widgets that accept the following parameters: sys_id, table, view.
The out of box page for this is Ticket Form.
Thanks,
Vinitha.K
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-25-2017 06:16 AM
Hi Vinitha,
I've got a further requirement for my filter. Some our customers belong to a parent company and I would need the filter to show any logs that are for the logged in users company or any of their child companies. Our implementation partner created a script includes that is used in other parts of the system. Is this something that can be used within the filter or do I need to do something else? below is the script includes: