+ Start a Discussion

Custom Button to export a List view to Excel

Hi All,
I have to export the Selected Records from List View by using Button.
I have tried to use the VF page and Calling custom extension controller, but I am not able to display the Button in List View in Salesforce Lightning.

Basically I need a Button on All Accounts to export the selected Records into csv or Excel. I can use the Reports, but every time we need to create a report and export. Instead of I need a custom button to export to csv.

Khan AnasKhan Anas (Salesforce Developers) 
Hi Naren,

Greetings to you!

You can create custom lightning component. Please refer to the below links which might help you further with the above requirement.

Lightning Aura Component:


Lightning Web Component:


I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas
Hi @Naren9, 

I have created an application that will exactly do your job, and it's free of cost too! 

Follow this link: https://github.com/rahulsharma-github/Export2Excel

Please appreciate the hard work by marking this answer as best if you find this solution helpful
Kevin Kristoffer BalaresKevin Kristoffer Balares
Hi @Rahul-Sharma,

Your app was a great help on our org, many thanks!

Would it also be possible for this to be available in Communities? Currently, the VF Page that handles the export Lists: the controller and the VF Page are looking for an object name to reference, however, the way it is coded presently seems like it is being obtained from the URL we place into the button. Can you help us to get the object hard coded into the VF Pages for the Export Lists function?

lisa johnson 15lisa johnson 15
@rahul-sharma - I have installed your product and it is working great on objects except the contact.  When I went back to git hub to raise an issue, the listing was removed - are you able to assist with my problem?
yosra Saidani 24yosra Saidani 24
@rahul-sharma unfortunately , the page is not found .can you share you component please .
Andrew FawcettAndrew Fawcett
@Rahul-sharma the link provided is not working,can you please share it again