- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2025 09:17 AM
Dear team,
Iam new to serviceNow, i have an issue that my button is not visible even wheb the condition was true!
my condition is: current.state === 1 && gs.getUserID().isMemberOf(current.assignment_group)
explanation: the button must be visible when the state was new and the loggedin user was a member of the current assignment group.the button was not visible evn when condition become true.i impersonate myself as an member of the assignment grp and state was new but the prblm ws button wasnt visible.
preview: i have checked form button
i have checked everything from reading other article evnthough itwasnot working
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2025 09:03 PM
Hi @Fahimas ,
The type of current.state will return an object and when you compare an object with number it will return you false, since you are using AND operator when the initial condition is false it will not test the other conditions. You can use == to compare state value.
And instead of getUserID use getUser(). getUser() return entire user object where as getUserID() return only the sys_id of the particular user.
current.state == 1 && gs.getUser().isMemberOf(current.assignment_group)
Mark this helpful/ Accept the solution if this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2025 03:24 PM
Hi @Fahimas
You need to update code like this try both ways
current.state == 1 && (gs.getUser().isMemberOf('Test1' ) || gs.getUser().isMemberOf('Test2'))
((current.state=='new' && gs.getUser().isMemberOf(current.assignment_group.toString())) || ((current.state=='open' && gs.getUser().isMemberOf(current.assignment_group.toString()))
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2025 03:40 PM
Hello @Fahimas
Please check if the insert or update checkbox is checked to specify when the ui action will be visible. Also one of the form button, form menu should also be checked to make it visible. These are some small things apart from condition. But if neglected, the action wouldn't be visible.
Regards,
Shivalika Gupta
Servicenow Developer - Schaeffler
Please mark my answer as helpful if it helped you in anyway.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2025 07:46 PM
I haved checked it already!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2025 08:35 PM
I have checked them evethough it was not visible