Selecting Records to be exported when using elixir elixlsx

Hello, I a creating an excel export functionality using the library elixlsx in elixir. I followed this steps from: Phoenix/Elixir — Export data to XLSX | by Sergey Chechaev | Medium, the issue I am experiencing is how to export only selected records from any given list. any suggestion

You have to send the selected record ids in your link to your endpoint/controller somehow. Either through a form or as query parameters in the link in the export button.
Then in your controller you can filter the records as per selections and pass them to the render function.