How can I download Google Sheet data as .csv using mit ai2?
Why not search the community? You could find something like this
If google sheet is set to anyone with the link, then you could use the spreadsheet component, or
this
or this
If google sheet is set to restricted then a google apps script and/or extension, or full use of the spreadsheet component with the service account.
How can I use this block? This block is providing option to upload .csv file in designer section. What is the use of it?
My alternative plan is to make users to click a button and get this specific .csv file (via sharing component). 'THE .CSV FILE IS SAME WITH SAME CONTENT FOR ALL USERS ALWAYS'. So, can I embed this specific .csv file within app and users can download and use it.
Assuming fileScope = Asset
in the Designer, and your csv is in your assets (media folder)
Set your filename, then use Rows to return an AI2 list of your csv data:
Original data example:
Shenandoah N.P.,1111111111,35.7647,-82.2653
Yosemite N.P.,1111111111,37.8651,-119.5383
Sequoi N.P.,1111111111,36.4864,-110.5885
El Capitan N.P.,1111111111,37.7339,-119.6377
Acadia N.P.,1111111111,44.33897,-68.27343
Mesa Verde N.P.,1111111111,37.23087,-108.46184
Yellowstone N.P.,1111111111,44.4279,-110.58838
Zion N.P.,1111111111,37.31721,-113.02254
Haleakala N.P.,1111111111,20.70128,-156.17312
Petrified Forest N.P.,1111111111,34.90999,-109.80679
Use of Columns will transpose the data to an AI2 list by column.
How can we get back the original file (in original format)?
You have it, there, in your assets. Open it / Copy it / etc. using the File component.
I mean, how an user can download this specific .csv file in its actual format using my app.
Download ? From where ? To where ?
instead of download, i offered share option. How they will get the original file?
You want your user to be able to share a file in assets with someone else?
They have to share the default .csv file to their email/whatsapp from the app. After that they will edit using Google Sheet and update the data in upcoming rows.
This component Data File has only very limited blocks.
It is very good at what it does.
The only missing block is 'BLOCK TO PROVIDE THE .CSV CONTENT AS IT IS'. Header row at the top and other rows below it.
If that block was there, I could allow users to download/share that .csv file in its original format.
Okay, I shall drop this component and go for alternative way to achieve this.
Not sure what your issue is. Using rows DataFile returns all rows, including the header row for me:
Okay, I think it is showing all rows in a single row (when i opened in a google sheet, everything shown in a single row).
Then you are not handling the data correctly when you send it to the google sheet. You have not shown how you are doing that. You cannot just upload an AI2 list to a spreadsheet and expect it to tabulate correctly...
Actually, I am testing using phone. Sometimes it may work in desktop, I have to check it.