How to create a button on service portal to export the data in excel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2024 08:22 AM
Hi,
I want to create an export to excel button that exports the data that is coming on the portal page from API, we are not storing that data in the servicenow table but we want to export it directly from the page view.
How we can achieve this.
Regards,
Aditya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2024 09:01 AM
Hi @aditya174,
Create a UI Action:
- Navigate to System Definition > UI Actions.
- Create a new UI Action for the table you want to export.
(function runAction(){
var exportUtil = new ExportUtil();
var data = exportUtil.exportData();
gs.eventQueue('export_to_excel_event', current, data, gs.getUserID());
})();
Thank you, please make helpful if you accept the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2024 09:10 AM
Hi,
I want to have that functionality on service portal widget, im not storing the table data on servicenow table, so i want to export from the page using the button rather than creating a ui action on table, can you help me with this.
Regards,
Aditya