- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā11-20-2020 05:00 AM
Hi Experts,
How to use if condition of following script in flow designer. gs.getuser().ismemberof('current.cmdb_ci.support_group')
Regards
Rajveer
Solved! Go to Solution.
- Labels:
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā11-24-2020 02:27 PM
Tested with below.
1. Inputs: cmdb_ci is of type "Reference.Configuration Item"
2. Script step: Input Variable name is "supportGroup" and Value is "action -> cmdb_ci -> Support group -> Name". I just selected it from data pill on the right side of the page under "cmdb_ci" > Support group" > "Name".
Created Output Variables named "ismember" (Label is "isMember") of type "True/False".
3. In my Configuration Items table, there is a record named "apache linux den 200" that has Support group "IT Securities". I've added myself as a member of group "IT Securities".
4. Test the created action. Select "apache linux den 200" as input.
5. Test result is "true".
6. Rerun the test but this time select "Blackberry" that has "Support group" set to "Capacity Mgmt" which I'm not a member of.
7. Test output returns "false".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā11-22-2020 08:04 PM
Thanks Ankur,
I tried in flow action ,but it's not working
Please check , following flow action.
Inputs : approval = reference.cmdb_ci
outputs : True/false
script :
if (answer = gs.getuser().ismemberof(inputs.approval.support_group)) {
outputs.answer = 'yes';
}
else
{
outputs.answer = 'no';
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā11-22-2020 08:55 PM
Hi,
please share the screenshot
try this
if (gs.getUser().isMemberOf(inputs.approval)) {
outputs.answer = 'yes';
}
else
{
outputs.answer = 'no';
}
Regards
Ankur
Ankur
⨠Certified Technical Architect || ⨠9x ServiceNow MVP || ⨠ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā11-22-2020 04:51 AM
Hope you are doing good.
Let me know if I have answered your question.
If so, please mark appropriate response as correct & helpful so that this thread can be closed and others can be benefited by this.
Regards
Ankur
Ankur
⨠Certified Technical Architect || ⨠9x ServiceNow MVP || ⨠ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā11-21-2020 08:04 AM
Hi Rajveer
You have to create a script step.
Check this Link
https://docs.servicenow.com/bundle/paris-servicenow-platform/page/administer/flow-designer/reference/javascript-step-action-designer.html
https://community.servicenow.com/community?id=community_question&sys_id=5f2a57971ba98090ada243f6fe4bcbc9
Regards
Pranav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā11-22-2020 07:57 PM
Thanks Pranav,
I tried in flow action ,but it's not working
Please check , following flow action.
Inputs : approval = reference.cmdb_ci
outputs : True/false
script :
if (answer = gs.getuser().ismemberof(inputs.approval.support_group)) {
outputs.answer = 'yes';
}
else
{
outputs.answer = 'no';
}