- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2023 11:57 PM
Hi All, I have a custom Menu item name "Test".
My requirement as follows:
1. I need to make it visible only for users who are part of a specific table
2. Example : there are multiple tables in Snow but I have a custom table "u_xyz". A logic should be applied that the instance analyzes the "logged in" user if he is part of the "u_xyz" table and if yes the "test" Menu item should be visible. Else it should not be visible.
Need help to achieve the same.
Thanks,
@Ankur Bawiskar @Community Alums @Allen Andreas @SatyakiBose @newhand
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2023 12:46 AM
@babarat1 you can just try this
var loggedIn = gs.getUserID();
var grgetUser = new GlideRecord('u_authorized_approver');
grgetUser.addQuery('u_user',loggedIn);
//grgetUser.addQuery('u_user.active','true');
grgetUser.query();
if(grgetUser.next())
return true;
else
return false;
If my answer solved your issue, please mark my answer as ✅Correct & 👍Helpful
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2023 12:08 AM
Hi @babarat1
you can write a script include to check if the loggedin user is part of table 'XYZ' and call that script in the condition part of Menu item.
If my answer solved your issue, please mark my answer as ✅Correct & 👍Helpful
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2023 12:16 AM
Hi,
Thanks for the reply Priya
can you share any reference script that can be used and should we call it using "javascript:" like in any other reference qualifiers/condtions.
TIA.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2023 12:18 AM
@babarat1 in the condition you can write it in this way
new ScriptIncludename.functionname()
If my answer solved your issue, please mark my answer as ✅Correct & 👍Helpful
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2023 12:17 AM