Quick answer: Call an Apex method that reads the records with WITH USER_MODE . In JavaScript, turn the rows into CSV text, and put quotes around any value that contains a comma, a quote or a line break. Add a UTF-8 byte order mark so Excel shows special characters correctly, then download the file with a Blob . You don't need a library or file storage, and the same steps work in Aura. "Can I download this as a spreadsheet?" comes up on almost every custom Salesforce screen. Building the CSV in the browser is fast, needs no file storage, and keeps the work off the server. In this guide you'll build one reusable CSV helper for Lightning Web Components (LWC), a secure Apex query, and an Aura version for older components. You'll also see the mistakes that most often break exports.