Does anybody know if it is possible to create reports through Thunkable. I store data in firebase, I would like the user to be able to press a button in the app and it creates a csv/pdf file of the data aligned with their User ID and sends that to their email address? Happy to use other software or an API to do it if anybody knows of any?
The csv format is very simple. You can create it yourself.
First, get all data from Firebase and then combine them into a string using the “,” symbol and send it by email using the Share block. If you wish, you can separate the data fields with a tab, and the lines with a newline.
Does anyone have any experience with Firebase Cloud Functions or an API that could convert JSON to CSV… my end goal is to pull information from firebase then send an email to the users address with a CSV or PDF attachment of their reporting when they click “Generate” in the app
Thunkable X does not support file saving, but you can send CSV data via email or messenger.
If you need a file, you need to look for an API service that allows you to transfer text to it, and it will make them an file and send it by mail, or write a server script for this yourself.
If anyone is further interested in this, I have figured out a way to do this as below:
1 - Pull the JSON data back from Firebase
2 - Turn that data into HTML using blocks
3 - Use restpack.io API to convert this HTML to PDF
4 - Use sendgrids API to send this link to the user
Works quite well, Sendgrid is has free use for 100 emails a day, and restpack.io is a about $9 usd a month but is seemless.