Can I export CSV files directly from a button from the UI? The flow would be, a user clicks on a buttton and it automatically generates a CSV file to send to an email. Thank you.
@Maximiliano_Gibert, there are many ways to export data. I will walk through a couple of these below.
From the Losant UI
The two ways listed below use the Losant UI and sends an email with a link to download the CSV file.
- For a bulk device data export, you can use the Request Data Export button from the Bulk Device Actions dropdown menu as shown in the Devices - Bulk Actions - Request Data Export documentation, which will allow you to enter an email address and a time range for the data.
- For one device data export, you can use the same means as number or 1, or you can click on your device and then click the
Device Actions
dropdown menu and then selectRequest Data Export
, which will allow you to enter an email address and a time range for the data. More on this can be found in the Devices - Request Data Export documentation.
From a Losant Dashboard
You can export data from a Losant Dashboard (this includes if it is embedded into your end-user experience) by using the Device State Table dashboard block. This will download the CSV file via the browser.
From an End-User Experience
In an end-user experience, you can enable a user to request a CSV file by a button. You have the options to download the file via the browser if the file is not too big or by sending an email like you mentioned. In another forums post which can be viewed here, Dylan walks through two ways to implement this. If you follow Dylan’s first method, then you would do steps 1-4 and your final steps would be emailing the CSV file to the user.
There is another forums post which can be viewed here, where Brandon shows how you can email a CSV file as an attachment or email a link to the user to download the CSV file.
I hope this helps. Please let us know if you have further questions.