How to hide/show Export XML context menu only for specific tables and specific user roles?

Viktor Petrov
Tera Contributor

Hello,

I have the task to show/hide the Export XML option in the context menu only for specific tables and specific user roles.

The problem is that I don't want these users to have access to the Export XML for the OOB tables.

Can someone help?

Best Regards,

Viktor

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

go to UI context menu

Open the record for Export on Global table

Then open the Context Menu for XML

Update condition for the table and give the role for which you wish to hide

I am hiding it for incident table and added role

Similarly you can exclude tables you want

gs.hasRightsTo("ui/context_menu.export_xml/read", null) && ListProperties.getTable() != 'incident' && !gs.hasRole('my_role')

find_real_file.png

find_real_file.png

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

go to UI context menu

Open the record for Export on Global table

Then open the Context Menu for XML

Update condition for the table and give the role for which you wish to hide

I am hiding it for incident table and added role

Similarly you can exclude tables you want

gs.hasRightsTo("ui/context_menu.export_xml/read", null) && ListProperties.getTable() != 'incident' && !gs.hasRole('my_role')

find_real_file.png

find_real_file.png

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Gopi Kumar
Tera Contributor

Hi @Ankur Bawiskar

we have a similar requirement for the show xml context menu, i have tried to use the same condition but still no luck. Just wanted to add one thing here our table is in scoped application. 

Thanks

Can you post a new question for this as this is quite older one and tag me there?

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader