- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-31-2017 12:20 AM
Hi All,
I have an another requirement as below,
I have a choice list field where this field is referenced to 'sys_users' table. So that we can choose more than one user as per our requirement.
Based on this choice list field i have an UI action.
Condition for the UI action is
UI action should appear to the users who are all chosen in the choice list field.
So i have tried with the below conditions its not working. Can someone help me?
current.cl_ownerLIKEjavescript;gs.getUserID();
Thanks,
Malaisamy
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-31-2017 12:26 AM
3 Using indexOf("searchString")
Use indexOf("searchString") to return the location of the string passed into the method if the glide list field, such as a Watch list, has at least one value in it. If the field is empty, it returns undefined. To avoid returning an undefined value, do any of the following:
- Force the field to a string, such as: watch_list.toString().indexOf("searchString")
- Check for an empty Glide list field with a condition before using indexOf(), such as: if (watch_list.nil() || watch_list.indexOf("searchString") == -1)
See if this helps.
http://wiki.servicenow.com/index.php?title=Referencing_a_Glide_List_from_a_Script#gsc.tab=0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-19-2017 10:28 AM
The ServiceNow Wiki content is no longer supported. Updated information about this topic is located here: Referencing a Glide List from a Script
Visit http://docs.servicenow.com for the latest product documentation

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-31-2017 01:23 AM
Hi Malaisamy,
I think the previous answers already pointed you to the right direction.
Try the following as your UI Action condition:
current.cl_owner.toString().indexOf(gs.getUserID()) > -1
Regards,
Stefan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-31-2017 02:28 AM
Hi Stefan,
Its working fine.
Thanks
Malaisamy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-31-2017 02:56 AM
HI,
If your question is answered , please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.
https://community.servicenow.com/docs/DOC-5601