Export Glide Table/ Google Sheet Data to CSV using Joined List & Apps Script

Hey Gliders,
I’ve implemented a quick & easy way to export data. This will help to export any kinda glide computed columns to CSV.
Let’s have a look on this,

Step 1
Create Template Column.
Call all the parameters you want in the CSV.
Add comma (,) at the end of each parameter.

Step 2
Go to another table instead of that.
Create a column Joined List
Call that template column into Joined List.
& In the separator just press an enter key. (Just one enter)

Screenshot 2021-06-01 at 5.35.47 PM

Step 3
Create Google Apps Script.
Create a folder in Google Drive.
Copy folder ID.

Copy Paste this script:

function doPost(e) {
// Calling Parameters from GlideApp
const body = JSON.parse(e.postData.contents);
const Data = body[“params”][“Data”][“value”];
const Name = body[“params”][“Name”][“value”];
const CSVName = Name + “.csv”;
const folderid = “FOLDER ID”;
const folder = DriveApp.getFolderById(folderid);
const file = folder.createFile(CSVName+".csv",Data).getId();
}

Click Deploy → New Deployment → Web App → Edit Access as anyone → Deploy
Copy Web App URL.

Step 4
Create Webhook Action from button.
Configure new webhook.
Paste the Web App URL and give it a name.

Add value:
Data → Joined list column
Name → Type file name

Fire the button.

CSV will be created on the folder.
Let me know if suggestions/ errors.

18 Likes

Nice.
For those that would prefer not to mess with Apps Script, you should be able to do the same using an Integromat Webhook.

PS. @Mark_Turrell this might interest you :arrow_up: :wink:

7 Likes

Exactly.
In some case integromat can exceed free quota.
You can create a csv with max 50mb in seconds with script. :grinning:

2 Likes

Kindly add headers value with comma to add headers into csv file.
For those who have a cell with “ can attach “” to each calling parameter in template columns to avoid errors.

Pro tip:
I’ve used to filter rows through creating a join list from relation column.

1 Like

Thanks @Purvang_Joshi Looks great. Will update you in case if I need any help in this regard.

1 Like

Will this work for any of the users of your app no matter how many users? If so, how can I they access their csv files… Would it be possible for the user to have a download prompt?

Maybe you’ll find this useful:

It uses the same technique.
And yes, as the app developer you control which users it is made available to.
If you have Row Owners, then users would only be able to export data from those rows that they “own”.

4 Likes

Great.
Thank you for sharing.

I’m having this problem, can you help me?

Erro de sintaxe: SyntaxError: Invalid or unexpected token, line: 4, file: Code.gs

1 Like

I copied and pasted but keep getting this error:

Screenshot 2024-01-31 120501

Me too.

The double quotes when you copied over might not be the standard double quotes GS expects. Please try changing them all to this instead: "

1 Like