Fixed query question
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2023 05:01 PM
Hello all,
I'm looking to get some assistance on using the Arguments field when limiting what certain users see when clicking on a custom Module. What I'm trying to do is have a certain group only see unpublished KBs they have authored and what ones they recently edited (newest version unpublished) so that they can update KBs when new info comes in. Currently I can just get them to only see their KBs they have authored using this:
I need to add something to the Arguments that also allows them to see KBs that have their name in the Updated By column on the Knowledge table. First issue is that the Updated By column calls User ID from the User table, where as Author calls the Name of the user from the User table. Looking in the sys_dictionary, I can't find any default value to use for Updated By when adding to the argument. (the Author column has a default value on the System Dictionary of "javascript:gs.getUserID()", [EDITED to have : in the example by website before submission] so that's what I used when creating my fixed query argument). I'm not sure how to "cheat" using the URL when generating a search using the filter normally, and I don't know how to make the query search for "me (dynamic)" so that this just pulls the current logged in user info when they click on the module.
What do I do in this case? Any help is greatly appreciated.
Thank you!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2023 05:29 PM - edited 02-15-2023 05:30 PM
Hello,
I'd recommend going to list view for your articles an then applying that query as you need such as:
author IS javascript(colon)gs.getUserID();
OR
updated by IS javascript(colon)gs.getUserName();
something like that. Once you have the query like you like, then right-click the last piece of the query breadcrumb and choose "copy query"...then come back here to the place in your screenshot and paste that as the fixed query.
Other user objects referenced here: https://servicenowguru.com/scripting/user-object-cheat-sheet/#:~:text=The%20GlideSystem%20(gs)%20use...
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!