# Scripts, scripts, scripts!

**URL:** <https://community.glideapps.com/t/scripts-scripts-scripts/18965>\
**Category:** Ask for Help\
**Created:** [November 26, 2020, 6:15pm UTC](https://community.glideapps.com/t/scripts-scripts-scripts/18965 "2020-11-26T18:15:21Z")\
**Posts on this page:** 20\
**Page:** 8

<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:** [February 25, 2021, 9:36am UTC](https://community.glideapps.com/t/scripts-scripts-scripts/18965/143 "2021-02-25T09:36:27Z")

</div>

I don’t think you need a script for this.  
Assuming that I understand correctly, here is how it can be done:

- In table A:
  - create a template column that concatenates the values of each column you need to use to compare

- In table B:
  - create a similar template column as per table A

- In your Glide Form:
  - create User Specific Columns to temporarily store the input values
  - create a 3rd template column to concatenate these values. The format should be identical to the template columns you created in Table A and Table B
  - now create two relations. One joining to Table A (call that rel-A), and the other joining to Table B (call that rel-B)
  - if rel-A is not empty, you have a duplicate of a row in Table A
  - if rel-B is not empty, you have a duplicate of a row in Table B

- the logic to decide which tables to write to based on the state of the relations can be handled within a custom action sequence

---

<div class="post-metadata">

**Author:** ![Antonoff](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/antonoff/32/22045_2.png) [@Antonoff](https://community.glideapps.com/u/Antonoff)\
**Post date:** [February 25, 2021, 11:59am UTC](https://community.glideapps.com/t/scripts-scripts-scripts/18965/144 "2021-02-25T11:59:08Z")

</div>

Thanks

> create a template column that concatenates the values of each column you need to use to compare

it is e column A +B + C = value for compare?

---

<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:** [February 25, 2021, 1:51pm UTC](https://community.glideapps.com/t/scripts-scripts-scripts/18965/145 "2021-02-25T13:51:04Z")

</div>

When I create template columns for this purpose, I usually do something like:

`{name}:{age}:{sex}`

And then I use replacements to substitute the actual values for each row.

 ![Screen Shot 2021-02-25 at 9.50.14 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/7/0743032118aa59557e43f16c977f4656d7dba16a.png)

---

<div class="post-metadata">

**Author:** ![Eric\_Penn](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/eric_penn/32/73888_2.png) [@Eric\_Penn](https://community.glideapps.com/u/Eric_Penn)\
**Post date:** [February 28, 2021, 6:56pm UTC](https://community.glideapps.com/t/scripts-scripts-scripts/18965/146 "2021-02-28T18:56:06Z")

</div>

Is it possible to have a google script detect new email from gmail and import a csv to sheets from an attachment? I was using Zapier but after 6+ months my zap is suddenly now broken and I’m in need of a fix…FAST! Trying Integromat I think I was close but couldn’t quite get it.

---

<div class="post-metadata">

**Author:** ![Drearystate](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/drearystate/32/49605_2.png) [@Drearystate](https://community.glideapps.com/u/Drearystate)\
**Post date:** [March 1, 2021, 3:31pm UTC](https://community.glideapps.com/t/scripts-scripts-scripts/18965/147 "2021-03-01T15:31:46Z")

</div>

I am unsure if you can do this with scripts. Which email service are you using? I use outlook and thankfully Microsoft in all of their wisdom allows VBA programming in outlook so I have VBA running code to download all attachments and emails to different folders so that I may use them in Power Bi and Glide.

---

<div class="post-metadata">

**Author:** ![Eric\_Penn](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/eric_penn/32/73888_2.png) [@Eric\_Penn](https://community.glideapps.com/u/Eric_Penn)\
**Post date:** [March 1, 2021, 3:50pm UTC](https://community.glideapps.com/t/scripts-scripts-scripts/18965/148 "2021-03-01T15:50:05Z")

</div>

Currently using Gmail but I could switch emails if it provides a solution. Without the ability to automate this process my business is imploding 😭

---

<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:** [March 1, 2021, 3:51pm UTC](https://community.glideapps.com/t/scripts-scripts-scripts/18965/149 "2021-03-01T15:51:04Z")

</div>

> [@Eric\_Penn](#):
>
> Is it possible to have a google script detect new email from gmail and import a csv to sheets from an attachment? I was using Zapier but after 6+ months my zap is suddenly now broken and I’m in need of a fix…FAST! Trying Integromat I think I was close but couldn’t quite get it.

I’ve never tried it, but I’m sure it’s possible. But way way easier with Integromat, I’d imagine.  
I really try to avoid scripts when there is an easier way…

---

<div class="post-metadata">

**Author:** ![Eric\_Penn](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/eric_penn/32/73888_2.png) [@Eric\_Penn](https://community.glideapps.com/u/Eric_Penn)\
**Post date:** [March 1, 2021, 3:53pm UTC](https://community.glideapps.com/t/scripts-scripts-scripts/18965/150 "2021-03-01T15:53:01Z")

</div>

I think I am close with Integromat but I don’t know what to put here under CSV??

 ![Screen Shot 2021-03-01 at 10.51.58 AM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/9/6/96fe6d03fdf3a6d5ba7b6397c11742af82c32402.jpeg)

---

<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:** [March 1, 2021, 3:58pm UTC](https://community.glideapps.com/t/scripts-scripts-scripts/18965/151 "2021-03-01T15:58:48Z")

</div>

Why are you watching a GDrive folder?  
I thought you were trying to parse an email attachment?  
What does your full scenario look like?

PS. We’re starting to cross the line into Integromat support, here…  
PS2. I’m not an Integromat expert by any stretch of the imagination (someone like @V88 might be able to offer better advice)

---

<div class="post-metadata">

**Author:** ![Drearystate](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/drearystate/32/49605_2.png) [@Drearystate](https://community.glideapps.com/u/Drearystate)\
**Post date:** [March 1, 2021, 4:19pm UTC](https://community.glideapps.com/t/scripts-scripts-scripts/18965/152 "2021-03-01T16:19:53Z")

</div>

@Robert_Petitto is really good @ Integromat as well 🙂

---

<div class="post-metadata">

**Author:** ![Eric\_Penn](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/eric_penn/32/73888_2.png) [@Eric\_Penn](https://community.glideapps.com/u/Eric_Penn)\
**Post date:** [March 1, 2021, 4:21pm UTC](https://community.glideapps.com/t/scripts-scripts-scripts/18965/153 "2021-03-01T16:21:05Z")

</div>

I would like to have two scenarios…one that watches GDrive and one that watches Email.

The GDrive scenario helps me if I need to troubleshoot or manually do something. The email scenario for regular automation.

Full scenario 1 Watch for new email \> Parse CSV to sheets  
Full Scenario 2 Watch Drive new file \> Parse CSV to sheets

I started work on Scenario 2

 ![Screen Shot 2021-03-01 at 11.24.26 AM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/c/0/c02262343df5395eac3d06e5b159079e9a7de1f3.png)

---

<div class="post-metadata">

**Author:** ![V88](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/v88/32/90054_2.png) [@V88](https://community.glideapps.com/u/V88)\
**Post date:** [March 1, 2021, 5:18pm UTC](https://community.glideapps.com/t/scripts-scripts-scripts/18965/154 "2021-03-01T17:18:06Z")

</div>

So in both cases you have a CSV that you need to parse and, I guess, for each row you then add a row to a Google Sheet? Where is the sticky point? I have used Integromat lots but never with CSV.

---

<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:** [March 1, 2021, 5:23pm UTC](https://community.glideapps.com/t/scripts-scripts-scripts/18965/155 "2021-03-01T17:23:34Z")

</div>

🙂 I’m getting better!

---

<div class="post-metadata">

**Author:** ![Eric\_Penn](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/eric_penn/32/73888_2.png) [@Eric\_Penn](https://community.glideapps.com/u/Eric_Penn)\
**Post date:** [March 1, 2021, 5:55pm UTC](https://community.glideapps.com/t/scripts-scripts-scripts/18965/156 "2021-03-01T17:55:12Z")

</div>

I am stuck on parse CSV. I’m not sure what to enter under the required field “CSV”?

I’m also unclear if this applies…  
“Hint: If your data comes in binary form, you have to use the `toString` function to convert it to String.”

> **Summary**
>
> ![Screen Shot 2021-03-01 at 10.51.58 AM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/9/6/96fe6d03fdf3a6d5ba7b6397c11742af82c32402.jpeg)

It appears I have all the other modules and fields filled out correctly, however I have not been able to test yet.

---

<div class="post-metadata">

**Author:** ![Pablo\_Sanz](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/pablo_sanz/32/16415_2.png) [@Pablo\_Sanz](https://community.glideapps.com/u/Pablo_Sanz)\
**Post date:** [March 1, 2021, 5:59pm UTC](https://community.glideapps.com/t/scripts-scripts-scripts/18965/157 "2021-03-01T17:59:36Z")

</div>

F … you are magicians !!!

What would a script be like to read a JSON from a webhook and write it in a new row in the spreadsheet?

I’ve been studying it for weeks but I still can’t understand at least the part of the JSON reading

✌🏾

---

<div class="post-metadata">

**Author:** ![ehdubya](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ehdubya/32/24087_2.png) [@ehdubya](https://community.glideapps.com/u/ehdubya)\
**Post date:** [March 1, 2021, 6:03pm UTC](https://community.glideapps.com/t/scripts-scripts-scripts/18965/158 "2021-03-01T18:03:31Z")

</div>

Dunno if you’ve read this yet or not but I’ve had to a few times and I had it bookmarked. There’s a snippet about Parse CSV in there that might help.

> **[CSV](https://support.integromat.com/hc/en-us/articles/360006248453-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.
> Aggregators
> Create CSV
> Merges selected text items ...

---

<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:** [March 1, 2021, 6:07pm UTC](https://community.glideapps.com/t/scripts-scripts-scripts/18965/159 "2021-03-01T18:07:48Z")

</div>

> [@Pablo\_Sanz](#):
>
> What would a script be like to read a JSON from a webhook and write it in a new row in the spreadsheet?

> [@Using App Script with a JSON API](https://community.glideapps.com/t/using-app-script-with-a-json-api/20051):
>
> Somebody who shall remain nameless (@SantiagoPerez - oops) asked me if I could put together a tutorial on working with API’s, so here it is. It’s my first tutorial, so please be gentle pray Whilst there is an app at the end of this, the app is not the main focus of the tutorial, so don’t expect to be impressed by that. The main focus is to give a gentle (?) introduction to Apps Script, and demonstrate how it can be used to interface with an API endpoint. I’ve tried to break down and explain t…

---

<div class="post-metadata">

**Author:** ![Eric\_Penn](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/eric_penn/32/73888_2.png) [@Eric\_Penn](https://community.glideapps.com/u/Eric_Penn)\
**Post date:** [March 1, 2021, 6:08pm UTC](https://community.glideapps.com/t/scripts-scripts-scripts/18965/160 "2021-03-01T18:08:13Z")

</div>

I did see that thank you. It’s a little above my paygrade.

I’m sure this is the section I need only I don’t have anything called “Data” or something similar.

> **Summary**
>
> ![Screen Shot 2021-03-01 at 1.06.53 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/7/075635d6e32ce60ce1635cab2959dd4e6996f83d.png)

---

<div class="post-metadata">

**Author:** ![V88](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/v88/32/90054_2.png) [@V88](https://community.glideapps.com/u/V88)\
**Post date:** [March 1, 2021, 6:24pm UTC](https://community.glideapps.com/t/scripts-scripts-scripts/18965/161 "2021-03-01T18:24:47Z")

</div>

When you are parsing any form of file, Integromat makes it really simple. Just get the file then dump its contents (e.g. data) into the CSV / JSON / XML field of your parsing module. I am out at the moment but will take a look later in you’re still stuck.

---

<div class="post-metadata">

**Author:** ![V88](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/v88/32/90054_2.png) [@V88](https://community.glideapps.com/u/V88)\
**Post date:** [March 1, 2021, 6:31pm UTC](https://community.glideapps.com/t/scripts-scripts-scripts/18965/162 "2021-03-01T18:31:43Z")

</div>

So. What you need to do is add another module in between Watch Files in Folder and Parse CSV. This should be a Download File module. It will download the file to Integromat. You can then use the Data output from this module to feed the CSV input to the Parse CSV module. And all will work as planned!

[Previous page](https://community.glideapps.com/t/scripts-scripts-scripts/18965.md?page=7)

[Next page](https://community.glideapps.com/t/scripts-scripts-scripts/18965.md?page=9)
