Simple list filter.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-30-2016 11:26 AM
Hey Guys, I am having an issue with the simple list filter field. I am trying to make a widget for the service portal that only shows "My closed incidents" I am able to show closed incidents, However I am not sure how to make it only show closed incidents of the current user signed into service portal. I have a similar widget named "My Requests" whose operation is very similar, but only showing open incidents. Its filter looks like this "caller_idDYNAMIC90d1921e5f510100a9ad2572f2b477fe^active=true^EQ". I have tried multiple methods of trying to get this right and i kinda feel like a fish out of water. Can you guys help point me in the right direction?
TLDR Question: How do I use the simple list widget "Filter" field to only show Closed Incidents of the current user signed into service portal?
- Labels:
-
Service Portal Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-30-2016 11:41 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-30-2016 12:01 PM
If you want a truly dynamic filter, without the hardcoded sys_id, you can use this:
caller_id=javascript:gs.getUserID()^active=false
The key is using javascript:gs.getUserID() to get the current user's sys_id.
Hope this helps.
Please feel free to connect, follow, mark helpful / answer, like, endorse.
John Chun, PhD PMP ![]() | ![]() |
Winner of November 2016 Members' Choice Award
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-30-2016 12:13 PM
Thanks guys, @dvp i didn't even think about doing it that way will remember that for next time. @John Chun i wrote some code similar to that and it didn't work However, I may or may not have made a small error of putting the ^ in the wrong place...How embarrassing Thanks for the quick response guys!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-30-2016 12:26 PM
Yes, encoded queries tend to be picky about small things like the placement of "^". I tested the query before posting and works as expected. If you want to use the Condition Builder UI, it has to be
[caller_id.sys_id] [is] [javascript:gs.getUserID()] AND
[active] [is] [false]
To get caller_id.sys_id, you'd have to first pick "Show Related Fields" at the bottom of the dropdown, and then pick Caller => User fields, and then Sys ID (a bit convoluted).