Restrict export of single column
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2017 06:33 AM
Hi All,
I have a requirement where i need to restrict export of single column . The column should be present in list view but whn exported all other columns of list should come but not the restricted one.
Kindly let me know for possible solutions.
Thanks in Advance
Regards,
VIjay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2017 06:47 AM
Hi Vijay,
I think you will have to go with some custom code instead of updating out of box button.
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2017 06:57 AM
Hi Vijay,
One solution is as below:
1) Create a list view and consider for example there are total 10 columns and you want to remove one from the export excel functionality
2) To this newly created list view add the 9 columns and skip the one which you want to restrict.
3) This will update the global export button so be careful to add that condition of table name check
Go to UI Context Menus in left nav -> search with name as Export -> Open it
Open the Context Menu with name as "Excel (.xlsx)" -> in the script section add this.
you will have to repeat this for other as well i.e. Excel, CSV context menu if you need.
if(g_list.tableName == 'table_name'){ // name of your table
sysparm_view = 'export_view'; // this is the newly created view which has 9 columns
}
This should work. I tested this and when user clicked on Export -> Excel(.xlsx) then only those columns came which were defined in the newly created list view.
Screenshot 1;
Screenshot 2:
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2017 03:49 AM
Hi Vijay,
Any update on this?
Can you mark my answer as correct, helpful and hit like if you were able to achieve the requirement. This helps in removing this question from unanswered list and helps users to learn from your thread. Thanks in advance.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-08-2017 06:14 AM
Hi Vijay,
Any update on this?
Can you mark my answer as correct, helpful and hit like if you were able to achieve the requirement.
This helps in removing this question from unanswered list and helps users to learn from your thread.
Thanks in advance.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader