- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2016 10:19 AM
I'm trying to figure out a script which has the syntax mentioned in the question, that is 'active=true^sys_idIN' + function( ). Can someone explain to me what does sys_idIN do here? Does it simply include the sys_id passes to the query as one of the a condition?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2016 11:23 AM
Use this
javascript: 'typeLIKExxxx^active=true^sys_idIN' + gs.getUser().getUserByID(user id).getMyGroups().toArray().join() + '^EQ'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2016 12:55 PM
This worked, but can you tell me how toArray().join() made the difference?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2016 01:03 PM
getMyGroups() does not give you sys_id's directly. It gives you an iterator
to the list of groups. You need toArray() method to convert it to an array
and then use join() to get the coma separated contents of the array
On Friday, August 19, 2016, darshak <community-no-reply@servicenow.com>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2016 01:09 PM
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2016 01:12 PM
One more thing, when I didn't use the change you suggested, I was able to list two groups among the many a user is member. Like if a user is a member in 4 groups or 3 groups, only 2 of them is always displayed. Does it have to do with the way with data handled and the limitations in the size of variables?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2016 05:56 PM
It will return you undefined values when you just use getMyGroups().
