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

**URL:** <https://community.glideapps.com/t/export-glide-table-google-sheet-data-to-csv-using-joined-list-apps-script/27467>\
**Category:** Project Showcase\
**Created:** [June 1, 2021, 12:45pm UTC](https://community.glideapps.com/t/export-glide-table-google-sheet-data-to-csv-using-joined-list-apps-script/27467 "2021-06-01T12:45:21Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Purvang\_Joshi](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/purvang_joshi/32/12645_2.png) [@Purvang\_Joshi](https://community.glideapps.com/u/Purvang_Joshi)\
**Post date:** [June 1, 2021, 12:45pm UTC](https://community.glideapps.com/t/export-glide-table-google-sheet-data-to-csv-using-joined-list-apps-script/27467/1 "2021-06-01T12:45:21Z")

</div>

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.

 ![Screenshot 2021-06-01 at 5.31.55 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/c/f/cfa34a10624987af58307e9b1fd13e74db51e48b.png)

**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](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/7/b718db7d8f170baef25525aead802fb994d0be02.png)

**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.

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [June 1, 2021, 12:48pm UTC](https://community.glideapps.com/t/export-glide-table-google-sheet-data-to-csv-using-joined-list-apps-script/27467/2 "2021-06-01T12:48:26Z")

</div>

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 ⬆ 😉

---

<div class="post-metadata">

**Author:** ![Purvang\_Joshi](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/purvang_joshi/32/12645_2.png) [@Purvang\_Joshi](https://community.glideapps.com/u/Purvang_Joshi)\
**Post date:** [June 1, 2021, 12:50pm UTC](https://community.glideapps.com/t/export-glide-table-google-sheet-data-to-csv-using-joined-list-apps-script/27467/3 "2021-06-01T12:50:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Purvang\_Joshi](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/purvang_joshi/32/12645_2.png) [@Purvang\_Joshi](https://community.glideapps.com/u/Purvang_Joshi)\
**Post date:** [June 1, 2021, 3:59pm UTC](https://community.glideapps.com/t/export-glide-table-google-sheet-data-to-csv-using-joined-list-apps-script/27467/4 "2021-06-01T15:59:26Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Pratik\_Shah](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/pratik_shah/32/12416_2.png) [@Pratik\_Shah](https://community.glideapps.com/u/Pratik_Shah)\
**Post date:** [September 11, 2021, 12:05pm UTC](https://community.glideapps.com/t/export-glide-table-google-sheet-data-to-csv-using-joined-list-apps-script/27467/5 "2021-09-11T12:05:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Keith\_Chikumbirike](https://avatars.discourse-cdn.com/v4/letter/k/5daacb/32.png) [@Keith\_Chikumbirike](https://community.glideapps.com/u/Keith_Chikumbirike)\
**Post date:** [October 5, 2021, 12:58am UTC](https://community.glideapps.com/t/export-glide-table-google-sheet-data-to-csv-using-joined-list-apps-script/27467/6 "2021-10-05T00:58:53Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [October 5, 2021, 1:48am UTC](https://community.glideapps.com/t/export-glide-table-google-sheet-data-to-csv-using-joined-list-apps-script/27467/7 "2021-10-05T01:48:21Z")

</div>

Maybe you’ll find this useful:

> [@How To: CSV Export and send as email](https://community.glideapps.com/t/how-to-csv-export-and-send-as-email/31618):
>
> Below is a short tutorial that demonstrates how to generate a CSV export from Glide, and send it as an email attachment using Integromat. This uses the joined list technique that was originally described by @Purvang_Joshi [here](https://community.glideapps.com/t/export-glide-table-google-sheet-data-to-csv-using-joined-list-apps-script/27467). I hope others find it useful slight_smile

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”.

---

<div class="post-metadata">

**Author:** ![Nadir\_Abdelrahman\_MD](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nadir_abdelrahman_md/32/5237_2.png) [@Nadir\_Abdelrahman\_MD](https://community.glideapps.com/u/Nadir_Abdelrahman_MD)\
**Post date:** [February 22, 2022, 5:22am UTC](https://community.glideapps.com/t/export-glide-table-google-sheet-data-to-csv-using-joined-list-apps-script/27467/9 "2022-02-22T05:22:30Z")

</div>

> [@Purvang\_Joshi](#):
>
> that

Great.  
Thank you for sharing.

---

<div class="post-metadata">

**Author:** ![Luiz\_Rai](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/luiz_rai/32/7093_2.png) [@Luiz\_Rai](https://community.glideapps.com/u/Luiz_Rai)\
**Post date:** [June 10, 2022, 2:56am UTC](https://community.glideapps.com/t/export-glide-table-google-sheet-data-to-csv-using-joined-list-apps-script/27467/10 "2022-06-10T02:56:09Z")

</div>

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

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

---

<div class="post-metadata">

**Author:** ![Kellar](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/kellar/32/69515_2.png) [@Kellar](https://community.glideapps.com/u/Kellar)\
**Post date:** [January 31, 2024, 8:04pm UTC](https://community.glideapps.com/t/export-glide-table-google-sheet-data-to-csv-using-joined-list-apps-script/27467/11 "2024-01-31T20:04:26Z")

</div>

> [@Purvang\_Joshi](#):
>
> 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();  
> }

I copied and pasted but keep getting this error:

 ![Screenshot 2024-01-31 120353](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/4/f/4f2ca1dc2a0268e1d1d4f101a88f70babde0dc79.png)

---

<div class="post-metadata">

**Author:** ![Kellar](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/kellar/32/69515_2.png) [@Kellar](https://community.glideapps.com/u/Kellar)\
**Post date:** [January 31, 2024, 8:05pm UTC](https://community.glideapps.com/t/export-glide-table-google-sheet-data-to-csv-using-joined-list-apps-script/27467/12 "2024-01-31T20:05:20Z")

</div>

![Screenshot 2024-01-31 120501](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/1/8/18f4d4f7a9ec20e4ca683770094e1d4714c4b2a3.png)

---

<div class="post-metadata">

**Author:** ![Kellar](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/kellar/32/69515_2.png) [@Kellar](https://community.glideapps.com/u/Kellar)\
**Post date:** [January 31, 2024, 8:05pm UTC](https://community.glideapps.com/t/export-glide-table-google-sheet-data-to-csv-using-joined-list-apps-script/27467/13 "2024-01-31T20:05:41Z")

</div>

Me too.

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [February 1, 2024, 12:18am UTC](https://community.glideapps.com/t/export-glide-table-google-sheet-data-to-csv-using-joined-list-apps-script/27467/14 "2024-02-01T00:18:28Z")

</div>

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