Exporting only selected records

I have a table block with many records, and I have an Export button.
When I select a few records and click Export, it exports all records, not only those selected.
How can I force it to export only the selected records?
Thanks!

Exporting selected data isn’t currently supported. You can filter the data first, and the export will include only the filtered results.