Condition if a user is not a member of a group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-17-2014 12:48 PM
It's simple Javascript question:
I'm looking to find how to check if a caller is not part of a group in a notification. I've successfully used isMemberOf to check for a group but not the reverse.
Any help would be appreciated!
- Labels:
-
Service Mapping
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-17-2014 01:25 PM
Would this be an acceptable script?
if (gs.getUser().getUserByID(current.task_for).isMemberOf('VIP Group')) {
answer = false;
} else {
answer= true;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-17-2014 01:37 PM
I believe you can shorten it to:
if (gs.getUser().isMemberOf("VIP Group"))
{
return true;
}
else
{
return false;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-18-2014 11:22 AM
Unfortunately, I don't think my code evaluates correctly. Also SN had an issue with "return true.". It wouldn't accept it as valid code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-18-2014 11:25 AM
Where is this code being executed? Is it a workflow script? If so, you will need to set answer to "true" or "false" like you did in your original post.