Hide export option from Form View
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2024 01:57 AM
I want to hide export option only from FORM view. How is it possible without DOM Manipulation.?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2024 02:26 AM
Hi,
You can control the export or remove it for a table/role in the list but on the form you cannot control it using any OOB configurations.
I think export to XML is only for Admins and rest anyone can do, no role restriction on the firm level.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2024 02:30 AM
Hi @Hm10 ,
Please refer he below link.
Open the table sys_ui_context_menu and search Export.
In the condition add like below
!ListProperties.isRelatedList() && !ListProperties.isRefList() && ListProperties.getTable() != "your custom table name"
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0676119
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2024 02:34 AM
Hey @Community Alums , This works on Lists, not on forms.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2024 02:35 AM
Hi @Hm10,
You can achieve this without directly manipulating the DOM by utilizing UI Policies or Client Scripts. Here's how you can do it using UI Policies:
1. Go to `System UI` > `UI Policies`.
2. Click on `New` to create a new UI Policy.
3. Provide a name and a short description for the UI Policy.
4. Under the `Table` field, select the table where your form is located (e.g., Incident, Change Request).
5. In the `Advanced` section, set the `When to apply` condition. This condition will determine when the UI Policy should be enforced. For example, you might want to apply it on a specific form view.
6. In the `Actions` section, add an action to hide the export option. You can achieve this by setting the action to `Hide` and specifying the field containing the export option (e.g., `sysverb_export`).
Here's a general example:
- Name: Hide Export Option from Form View
- Table: Incident (or the appropriate table)
- When to apply: Specify conditions to apply the UI Policy only on form views where you want to hide the export option.
- Action: Hide, Field: `sysverb_export` (or the appropriate field ID for the export option).
Once you save the UI Policy, it will be applied according to the specified conditions, hiding the export option on the designated form views.
Using UI Policies allows you to configure the hiding of elements without directly manipulating the DOM, providing a more maintainable and configurable solution within the ServiceNow platform.
Please hit helpful and accept this as a solution if solves your queries.
Regards: Raja Aqib