Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to download List view into excel

Hareesha
Tera Contributor

I need help to provide a button on top right corner to download list view as excel.I know i can go with export from list cloumn but i need a button. Thanks

1 ACCEPTED SOLUTION

@Hareesha yes you can do it like below 

function generateExcel()
{
g_navigation.open('/' + tableName + '_list.do?EXCEL&sysparm_query=your_query', '_blank');
}

PLEASE MARK MY ANSWER CORRECT IF IT HELPS YOU

 

View solution in original post

7 REPLIES 7

Mohith Devatte
Tera Sage
Tera Sage

hello @Hareesha ,

you can do one thing 

1)Create a UI action where check the check box LIST BANNER BUTTON like below and check the client check box and give the on click function name as generateExcel()

find_real_file.png

 2)Place the script as below 

function generateExcel()
{
g_navigation.open('/' + tableName + '_list.do?EXCEL', '_blank');
}

replace the table name 

PLEASE MARK MY ANSWER CORRECT IF IT HELPS YOU

Hi @Mohith Devatte  Thanks, its working. Is there any possibilty to add query to filter data and export

@Hareesha yes you can do it like below 

function generateExcel()
{
g_navigation.open('/' + tableName + '_list.do?EXCEL&sysparm_query=your_query', '_blank');
}

PLEASE MARK MY ANSWER CORRECT IF IT HELPS YOU

 

Is there anyway that we can change the name of excel file. I know in servicenow file name will be table name. Just wanted to confirm