Can I export a custom CSV file via UI action on the list page?

LinhN
Tera Contributor

Hi guys, I have a requirement that I have investigated but I am not sure about it. Our client has a custom CSV file, originally they can export from the UI action in a form. Now, they want to export custom CSV files for multiple records on the list page using UI action ( with the list banner button). Until now, I can not define whether we can download multiple records. Can you answer about this, whether we can implement it?  If we can, what should we do? Thank you so much. 

LinhN_0-1739158904051.png

 

2 REPLIES 2

Ankur Bawiskar
Tera Patron
Tera Patron

@LinhN 

since it's list banner, they need to select the checkboxes and then they can click

You will get the list of sysIds checked using this and then enhance it further

var sysIds = g_list.getChecked();

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Gurpreet07
Mega Sage

Hi,  Your shared code is not enough to figure this out however technically its feasible but you have to change the code. Few instructions: 

1. Check client

2. Use g_list..getChecked()    method to get the sys_ids of the checked records

3. Use glideAjax and pass these sys_ids to a server side function written in a script include

4. Write your code in script include to iterate over all these records and create one csv file for all these ids

5. Return back the link to csv file

6. Redirect the user to download that file