- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2023 09:43 PM
Hi Community,
I have a requirement to restrict users to access 'Export' context menu on list view . I want to only allow access to users who are part of 'Export data' group & has 'export_data' role for the following list:-
incident,request item, sc task & asset.
I added myself to 'export Data' group and group has role 'export_data' but not able to see 'Export' context menu for above tables. Below is the screenshot of 'Export' context menu configuration & system property:-
Could anyone please help what's wrong in this?
Thanks,
Ankita Kolhe
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2023 12:00 AM
update as this
!ListProperties.isRelatedList() && !ListProperties.isRefList() && gs.hasRole('export_data') && gs.getUser().isMemberOf('38d8e01bdb7ae910fcf5a51fd39619d2') && gs.getProperty('nwd.data.export.tables').indexOf(ListProperties.getTable()) > -1
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2023 10:05 PM
so it should show only for those tables mentioned in system property?
you can add role check there gs.hasRole('export_data') && gs.getUser().isMemberOf('Export data')
Can you share the condition here?
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2023 10:25 PM - edited 05-21-2023 10:26 PM
Hi @Ankur Bawiskar ,
Yes, it should visible to those tables only(listed on property).
I'm not sure if the property configured is in right way & also how to check for the current table in context menu condition.
condition:- !ListProperties.isRelatedList() && !ListProperties.isRefList() && gs.hasRole('export_data') && gs.getUser().isMemberOf('38d8e01bdb7ae910fcf5a51fd39619d2')
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2023 12:00 AM
update as this
!ListProperties.isRelatedList() && !ListProperties.isRefList() && gs.hasRole('export_data') && gs.getUser().isMemberOf('38d8e01bdb7ae910fcf5a51fd39619d2') && gs.getProperty('nwd.data.export.tables').indexOf(ListProperties.getTable()) > -1
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago
I have a similar requirement and thank you for the solution you have provided. I tried changing the Context menu -> Export file and an error appears saying - Warning: This is a High Risk file that might get updated again in later releases. Do not alter this file unless necessary.
Is it still ok to alter this file with the condition? Appreciate your reply. Thank you
