- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2021 02:42 AM
Hi All,
Please guide on, how i can export data into excel [.xlsx] via script.
Regards,
Suresh.
Solved! Go to Solution.
- Labels:
-
Incident Management
-
Multiple Versions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2021 08:06 AM
we forgot adding the underscore
now it should work fine
g_navigation.open('/' + tableName + '_list.do?EXCEL&sysparm_view=ess', '_blank');
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
05-10-2021 05:29 AM
Hi Ankur,
It is a generic/global task, normally from any table list, we do right click and export in .xlsx. Instead of that activity, just need to do the export data using script. That script can later on will be use in button for or any other. For now let assume for incident list.
Regards,
Suresh.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2021 05:52 AM
Hi,
then you can use this UI Action on your table
Type - List Banner button
Client Checkbox - true
Onclick - downloadRecords();
Script:
function downloadRecords(){
var tableName = 'incident';
g_navigation.open('/' + tableName + 'list.do?CSV&sysparm_view=ess', '_blank');
}
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
05-10-2021 06:01 AM
Hi Ankur,
I am able to download into csv file but not getting the data export in excel.
Regards,
Suresh.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2021 06:26 AM
So did you use the script I mentioned or you are using some other script?
if other script please share that
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
05-10-2021 06:37 AM