# Join List \> Integromat \> Create CSV

**URL:** <https://community.glideapps.com/t/join-list-integromat-create-csv/30323>\
**Category:** Ask for Help\
**Created:** [August 11, 2021, 5:12pm UTC](https://community.glideapps.com/t/join-list-integromat-create-csv/30323 "2021-08-11T17:12:18Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [August 11, 2021, 5:12pm UTC](https://community.glideapps.com/t/join-list-integromat-create-csv/30323/1 "2021-08-11T17:12:18Z")

</div>

Hey all!

I’m looking to create a CSV file from a Join List column. The Join List contains a comma-separated list of names and I’d like for each name to be on its own row of the CSV. Sounds simple enough, but I can’t figure it out.

Anyone know the magic?

---

<div class="post-metadata">

**Author:** ![PabloMFalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/pablomfalero/32/31166_2.png) [@PabloMFalero](https://community.glideapps.com/u/PabloMFalero)\
**Post date:** [August 11, 2021, 5:22pm UTC](https://community.glideapps.com/t/join-list-integromat-create-csv/30323/2 "2021-08-11T17:22:23Z")

</div>

Can integromat help with this? They have a CSV module if I’m not wrong … In Atlanta already btw 😉

> **[CSV App Help Docs | Integromat Help Center](https://www.integromat.com/en/help/app/csv)**
>
> Getting started with CSV The CSV aggregator and CSV transformer lets you create csv files and parse csv text from a received text value or a file. Ag

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [August 11, 2021, 5:34pm UTC](https://community.glideapps.com/t/join-list-integromat-create-csv/30323/3 "2021-08-11T17:34:09Z")

</div>

Right…I’m getting warmer!

---

<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:** [August 11, 2021, 6:03pm UTC](https://community.glideapps.com/t/join-list-integromat-create-csv/30323/4 "2021-08-11T18:03:30Z")

</div>

I’ve been doing this for a while, and it works like a charm. The trick is to use a template column to create the row, using a delimiter. And then a joined list to stitch all the rows together using crlf as the joined list separator. Then pass that through the webhook as a single value.

It’s late here now, but I can post a more detailed example in the morning if you need it.

I should add… the method I use requires just two Integromat modules: webhook and gmail. That’s it - no messing around with CSV or aggregator modules or any of that garbage 😉

---

<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:** [August 12, 2021, 1:46am UTC](https://community.glideapps.com/t/join-list-integromat-create-csv/30323/5 "2021-08-12T01:46:37Z")

</div>

> [@Robert\_Petitto](#):
>
> Right…I’m getting warmer!

Did you get this sorted?

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [August 12, 2021, 2:48am UTC](https://community.glideapps.com/t/join-list-integromat-create-csv/30323/6 "2021-08-12T02:48:06Z")

</div>

Yes, I was able to generate a CSV of names…but then I realized what I really wanted was to have a list of names within a populate a PDF template…no idea how to do that effectively.

---

<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:** [August 12, 2021, 2:53am UTC](https://community.glideapps.com/t/join-list-integromat-create-csv/30323/7 "2021-08-12T02:53:16Z")

</div>

oh, PDF is a different animal.  
I know that some people use PDFMonkey. I actually have a tried and tested method for generating PDF using apps script, that I’ve used on multiple projects. Essentially it involves creating a GDoc template, and then writing some code to plug in the data and convert the GDoc to PDF.

---

<div class="post-metadata">

**Author:** ![Manu.n](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/manu.n/32/11679_2.png) [@Manu.n](https://community.glideapps.com/u/Manu.n)\
**Post date:** [August 12, 2021, 3:04am UTC](https://community.glideapps.com/t/join-list-integromat-create-csv/30323/8 "2021-08-12T03:04:56Z")

</div>

Hello @Darren_Murphy s this technique quick to execute?  
Because I use the same thing.  
I made a webhook from glide to a google script, and I have a model under google sheet that I copy and replace the type values ​​{name} by the values ​​of the receipt by the webhook and finally I export to pdf.  
But it takes him about 1 to 2 minutes to do this operation.

---

<div class="post-metadata">

**Author:** ![Luther](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/luther/32/17929_2.png) [@Luther](https://community.glideapps.com/u/Luther)\
**Post date:** [August 12, 2021, 3:19am UTC](https://community.glideapps.com/t/join-list-integromat-create-csv/30323/9 "2021-08-12T03:19:11Z")

</div>

[Creating dynamic PDFs in integromat](https://youtu.be/ZenYtu4BRL8)

Hey @Robert_Petitto,  
I am not sure if this is what you are looking for but I think it may help you along. At least I hope it does…

---

<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:** [August 12, 2021, 3:19am UTC](https://community.glideapps.com/t/join-list-integromat-create-csv/30323/10 "2021-08-12T03:19:47Z")

</div>

This may help

> [@Export Glide Table/ Google Sheet Data to CSV using Joined List & Apps Script](https://community.glideapps.com/t/export-glide-table-google-sheet-data-to-csv-using-joined-list-apps-script/27467):
>
> 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 e…

---

<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:** [August 12, 2021, 3:26am UTC](https://community.glideapps.com/t/join-list-integromat-create-csv/30323/11 "2021-08-12T03:26:57Z")

</div>

Yes, the technique that I use is an adaptation of your method 🙂

---

<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:** [August 12, 2021, 3:29am UTC](https://community.glideapps.com/t/join-list-integromat-create-csv/30323/12 "2021-08-12T03:29:41Z")

</div>

> [@Manu.n](#):
>
> Hello @Darren_Murphy s this technique quick to execute?  
> Because I use the same thing.  
> I made a webhook from glide to a google script, and I have a model under google sheet that I copy and replace the type values ​​{name} by the values ​​of the receipt by the webhook and finally I export to pdf.  
> But it takes him about 1 to 2 minutes to do this operation.

I wouldn’t say it’s lightning fast, but it generally takes several seconds (not minutes) to generate each PDF. I could probably share some code if you wanted to compare notes…?

---

<div class="post-metadata">

**Author:** ![Manu.n](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/manu.n/32/11679_2.png) [@Manu.n](https://community.glideapps.com/u/Manu.n)\
**Post date:** [August 12, 2021, 3:33am UTC](https://community.glideapps.com/t/join-list-integromat-create-csv/30323/13 "2021-08-12T03:33:37Z")

</div>

Yes if possible,  
I would like to see your technique because  
my script is complicated finally not complicated but very personalized, with sorting of data and other stuff which greatly slows down the execution in addition to basic functions such as copying a sheet or exporting to pdf in google script.

---

<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:** [August 12, 2021, 4:15am UTC](https://community.glideapps.com/t/join-list-integromat-create-csv/30323/14 "2021-08-12T04:15:38Z")

</div>

Here is a somewhat generic example:

```auto
function create_pdf(data, obj) {
  console.time("Create PDF");
  var pdf_file_name = obj.user_name + ' - ' + obj.requested_at + '.pdf';
  pdf_file_name = pdf_file_name.replace(/,/g,"");
  var temp_folder = DriveApp.getFolderById(TEMP_FOLDER_ID);
  var saved_pdf_folder = DriveApp.getFolderById(SAVED_PDF_FOLDER_ID);
  var template = DriveApp.getFileById(PDF_TEMPLATE_ID);
  var temp_copy = template.makeCopy().moveTo(temp_folder);
  var temp_doc_id = temp_copy.getId();
  var temp_doc = DocumentApp.openById(temp_doc_id);
  var body = temp_doc.getBody();
  
  while (data.user_keys.length > 0) {
    body.replaceText('{' + data.user_keys.shift() + '}', data.user_values.shift());
  }

  var tables = body.getTables();
  var table = tables[0];
  var row = 1;
  while (data.shift_data.length > 0) {
    var row_data = data.shift_data.shift();
    var tr = table.insertTableRow(row);
    while (row_data.length > 0) {
      var text = row_data.shift();
      tr.appendTableCell(text);
    }
  }

  temp_doc.setName(pdf_file_name);
  temp_doc.saveAndClose();
  var temp_file_id = temp_doc.getId();
  var temp_file = DriveApp.getFileById(temp_file_id);
  temp_file.setName(pdf_file_name);
  var pdf = DriveApp.createFile(temp_file.getAs('application/pdf'));
  pdf.moveTo(saved_pdf_folder).setName(pdf_file_name);
  var pdf_file_id = pdf.getId();
  temp_file.setTrashed(true);
  console.timeEnd("Create PDF");
  return pdf_file_id;
}

```

Before creating the PDF, I collect the data from the GSheet and arrange it into a data structure, which is then used to inject the values into the PDF template.

These few lines:

```auto
while (data.user_keys.length > 0) {
    body.replaceText('{' + data.user_keys.shift() + '}', data.user_values.shift());
  }

```

basically do a search and replace through the entire template. The key to this is to match the GSheet column headers to the substitution variable names in the PDF template. For example, if I have a column in the GSheet called “Name”, it will have a matching substitution variable called “{Name}” in the template. So `data.user_keys` is essentially an array of my GSheet column headers, and `data.user_values` is an array of matching values from a specific row in the sheet.

And these few lines:

```auto
while (data.shift_data.length > 0) {
    var row_data = data.shift_data.shift();
    var tr = table.insertTableRow(row);
    while (row_data.length > 0) {
      var text = row_data.shift();
      tr.appendTableCell(text);
    }
  }

```

… build a table containing the values from several rows.

The rest of the code does the PDF conversion and saves it to a GDrive folder, and returns the generated File ID, which is written back into the GSheet, and becomes available to be used in Glide.

---

<div class="post-metadata">

**Author:** ![Manu.n](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/manu.n/32/11679_2.png) [@Manu.n](https://community.glideapps.com/u/Manu.n)\
**Post date:** [August 12, 2021, 4:20am UTC](https://community.glideapps.com/t/join-list-integromat-create-csv/30323/15 "2021-08-12T04:20:04Z")

</div>

Yes great,  
we have the same principle, but I’m going to do some tests with a google doc instead of a google sheet.

---

<div class="post-metadata">

**Author:** ![Manu.n](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/manu.n/32/11679_2.png) [@Manu.n](https://community.glideapps.com/u/Manu.n)\
**Post date:** [August 12, 2021, 4:21am UTC](https://community.glideapps.com/t/join-list-integromat-create-csv/30323/16 "2021-08-12T04:21:25Z")

</div>

The only big difference is that I use a webhook for the data and you the sheet linked to Glide.

---

<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:** [August 12, 2021, 4:29am UTC](https://community.glideapps.com/t/join-list-integromat-create-csv/30323/17 "2021-08-12T04:29:56Z")

</div>

Yes.  
The most common use case that I have is that a PDF needs to be generated whenever a new row is added.

- In such cases, I will have a “PDF Generated At” column in the GSheet
- When a new row is added from Glide, that column is empty
- A trigger script detects the new row (with the empty timestamp), and generates the PDF
- When done, it sets the “PDF Generated At” column to the current time

One thing I found is that you can get a race condition when using a trigger if there are multiple rows added quickly, which sometimes results in multiple PDF’s being generated. To avoid this, I write a value “Processing…” to the timestamp column _before_ generating the PDF. This prevents any subsequent script invocations from processing the same row before the first one is finished.

---

<div class="post-metadata">

**Author:** ![Manu.n](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/manu.n/32/11679_2.png) [@Manu.n](https://community.glideapps.com/u/Manu.n)\
**Post date:** [August 12, 2021, 4:32am UTC](https://community.glideapps.com/t/join-list-integromat-create-csv/30323/18 "2021-08-12T04:32:10Z")

</div>

excellent  
thank you for sharing 👍 😃 👋

---

<div class="post-metadata">

**Author:** ![Manu.n](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/manu.n/32/11679_2.png) [@Manu.n](https://community.glideapps.com/u/Manu.n)\
**Post date:** [August 12, 2021, 4:42am UTC](https://community.glideapps.com/t/join-list-integromat-create-csv/30323/19 "2021-08-12T04:42:40Z")

</div>

Sorry @Robert_Petitto for diverting your original subject (for my benefit)

---

<div class="post-metadata">

**Author:** ![Mark\_Turrell](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mark_turrell/32/26605_2.png) [@Mark\_Turrell](https://community.glideapps.com/u/Mark_Turrell)\
**Post date:** [August 12, 2021, 5:50am UTC](https://community.glideapps.com/t/join-list-integromat-create-csv/30323/20 "2021-08-12T05:50:46Z")

</div>

@Darren_Murphy ’s approach and code works a treat 🌟 he wrote the backend functions for my telemedicine app, including PDF generation, and emailing. Wizard work 🪄:mage:

[Next page](https://community.glideapps.com/t/join-list-integromat-create-csv/30323.md?page=2)
