function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Naren9Naren9 

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.

Thanks,
Naren
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:
http://www.vinaychaturvedi.com/blog/select-and-export-records-in-lightning-component/

https://www.sfdc-lightning.com/2019/10/export-to-csv-in-lightning-component.html

Lightning Web Component:
https://www.salesforcecodecrack.com/2019/05/export-data-as-csv-file-with-javascript.html

https://salesforcelightningwebcomponents.blogspot.com/2019/09/salesforce-export-to-excel-with.html

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
Rahul.SharmaRahul.Sharma
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?

Regards,
Kevin
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