# How to obtain SpreadsheetID and/or sheet name as a parameter?

**URL:** <https://community.glideapps.com/t/how-to-obtain-spreadsheetid-and-or-sheet-name-as-a-parameter/37687>\
**Category:** Ask for Help\
**Created:** [January 25, 2022, 7:51pm UTC](https://community.glideapps.com/t/how-to-obtain-spreadsheetid-and-or-sheet-name-as-a-parameter/37687 "2022-01-25T19:51:44Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Test\_Test](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/test_test/32/30930_2.png) [@Test\_Test](https://community.glideapps.com/u/Test_Test)\
**Post date:** [January 25, 2022, 7:51pm UTC](https://community.glideapps.com/t/how-to-obtain-spreadsheetid-and-or-sheet-name-as-a-parameter/37687/1 "2022-01-25T19:51:44Z")

</div>

Hi,  
For various reasons (among other for integrating with Integromat), it would be very useful to be able to obtain the spreadsheetID and/or the sheet name as parameters. This is especially useful when backing up and creating a copy of the spreadsheet. It will ensure Integromat is always referring to the relevant Spreadsheet.  
Thanks

---

<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:** [January 25, 2022, 8:27pm UTC](https://community.glideapps.com/t/how-to-obtain-spreadsheetid-and-or-sheet-name-as-a-parameter/37687/2 "2022-01-25T20:27:25Z")

</div>

I’m not sure about obtaining the spread sheet ID but for the purpose of creating a copy/ backup, here is a simple script courtesy of @Jeff_Hager

```auto
function makeCopy() {

// generates the timestamp and stores in variable formattedDate as year-month-date hour-minute-second
var formattedDate = Utilities.formatDate(new Date(), "GMT", "yyyy-MM-dd' 'HH:mm:ss");

// gets the name of the original file and appends the word "copy" followed by the timestamp stored in formattedDate
var name = SpreadsheetApp.getActiveSpreadsheet().getName() + " Backup " + formattedDate;

// gets the destination folder by their ID. REPLACE xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx with your folder's ID that you can get by opening the folder in Google Drive and checking the URL in the browser's address bar
var destination = DriveApp.getFolderById("YOUR-FOLDER-ID");

// gets the current Google Sheet file
var file = DriveApp.getFileById(SpreadsheetApp.getActiveSpreadsheet().getId())

// makes copy of "file" with "name" at the "destination"
file.makeCopy(name, destination);
}

```

---

<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:** [January 25, 2022, 11:42pm UTC](https://community.glideapps.com/t/how-to-obtain-spreadsheetid-and-or-sheet-name-as-a-parameter/37687/3 "2022-01-25T23:42:18Z")

</div>

So you’re using a Spreadsheet ID in Integromat instead of choosing it from a list?

---

<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:** [January 26, 2022, 1:23am UTC](https://community.glideapps.com/t/how-to-obtain-spreadsheetid-and-or-sheet-name-as-a-parameter/37687/4 "2022-01-26T01:23:04Z")

</div>

> [@Test\_Test](#):
>
> it would be very useful to be able to obtain the spreadsheetID and/or the sheet name as parameters.

so that you can… send via a webhook?

I’ll tell you what I do.  
In Integromat I create a small data store and use it store various parameters related to my apps, including the Glide App ID, backend SpreadsheetID, backup FolderID, API parameters, etc, etc.

 ![Screen Shot 2022-01-26 at 9.21.50 AM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/f/9/f9d47527df03798abad6b64248ec67139022f2d5.png)

Every Webhook from Glide includes the AppID, so in most of my scenarios the first thing I do is take that and do a lookup in my data store, and then I have all the parameters that I need for that app. It also helps me to confirm that the webhook has come from one of my apps.

---

<div class="post-metadata">

**Author:** ![Test\_Test](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/test_test/32/30930_2.png) [@Test\_Test](https://community.glideapps.com/u/Test_Test)\
**Post date:** [January 26, 2022, 7:47am UTC](https://community.glideapps.com/t/how-to-obtain-spreadsheetid-and-or-sheet-name-as-a-parameter/37687/5 "2022-01-26T07:47:50Z")

</div>

> [@Darren\_Murphy](#):
>
> small data store and use it store various parameters related to my apps, including the Glide App ID, backend SpreadsheetID, backup FolderID, API parameters, etc, etc.

Super cool idea! 👍

---

<div class="post-metadata">

**Author:** ![Test\_Test](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/test_test/32/30930_2.png) [@Test\_Test](https://community.glideapps.com/u/Test_Test)\
**Post date:** [January 26, 2022, 7:56am UTC](https://community.glideapps.com/t/how-to-obtain-spreadsheetid-and-or-sheet-name-as-a-parameter/37687/6 "2022-01-26T07:56:28Z")

</div>

> [@ThinhDinh](#):
>
> So you’re using a Spreadsheet ID in Integromat instead of choosing it from a list?

Yes, exactly. This is to prevent mismatches when changing the spreadsheet or any other backend changes.

---

<div class="post-metadata">

**Author:** ![Test\_Test](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/test_test/32/30930_2.png) [@Test\_Test](https://community.glideapps.com/u/Test_Test)\
**Post date:** [January 26, 2022, 4:15pm UTC](https://community.glideapps.com/t/how-to-obtain-spreadsheetid-and-or-sheet-name-as-a-parameter/37687/7 "2022-01-26T16:15:05Z")

</div>

I’m having some challenges with the Search rows module. I’ve [posted the question on the Integromat community](https://www.facebook.com/groups/integromat/posts/4546558695454728/) page but thought perhaps someone here can also pick it up and assist.  
Thanks

---

<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:** [January 26, 2022, 11:58pm UTC](https://community.glideapps.com/t/how-to-obtain-spreadsheetid-and-or-sheet-name-as-a-parameter/37687/8 "2022-01-26T23:58:31Z")

</div>

I’m not in that group and have to request to join. Can you share what your problem is in screenshots?

Edit: They approved my request to join, but please post your questions here next time instead of linking it somewhere else that requires joining a group.

I’m reposting it here so others can chime in.

> As you can see in the screenshot, I’m using a Data Store to fetch the SpreadsheetID but manually input the Sheet name.  
> I actually have two issues, which might be connected:  
> I’m not seeing the headers, although I selected “yes”. Screenshot attached.  
> When I “Run this module only” I input the SpreadsheetID and the “Equal to” parameters manually. It runs fine (no error) but doesn’t find anything (0 output bundles). When I change the module setting an input a manual “Equal to” parameter (SpreadsheetID left as a parameter which I input manually when running only that module), it works fine and it finds the correct row.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/e/b/eb98986ebdaac04eb8b2eb1118e054f7a5f0a57b.jpeg)

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/e/d/ed7327993fdc4eef283a656cae06a23c99062ec5.jpeg)

---

<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:** [January 27, 2022, 12:06am UTC](https://community.glideapps.com/t/how-to-obtain-spreadsheetid-and-or-sheet-name-as-a-parameter/37687/9 "2022-01-27T00:06:42Z")

</div>

From what I know, the column names would only show up when you have a non-dynamic Spreadsheet/Sheet ID as an input.

Let’s say you choose “Spreadsheet 1” and “Sheet 1” as your inputs, then Integromat knows exactly what to look at, and show the column names for you.

If you try to make it dynamic like this one, I don’t think they return the names. Is that a big problem for you?

I’m not sure I understand your second question. Do you mean when you manually input something it works?

---

<div class="post-metadata">

**Author:** ![Test\_Test](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/test_test/32/30930_2.png) [@Test\_Test](https://community.glideapps.com/u/Test_Test)\
**Post date:** [January 27, 2022, 6:47am UTC](https://community.glideapps.com/t/how-to-obtain-spreadsheetid-and-or-sheet-name-as-a-parameter/37687/10 "2022-01-27T06:47:45Z")

</div>

> [@ThinhDinh](#):
>
> Do you mean when you manually input something it works?

Yes. It’s very strange. If I search for a dynamic parameter, it returns zero bundles. If I input a manual parameter, it returns as requested. I’ve of course checked letter-case, exact string (copy&paste), selected case-insensitive, etc. Nothing works ☹

---

<div class="post-metadata">

**Author:** ![Test\_Test](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/test_test/32/30930_2.png) [@Test\_Test](https://community.glideapps.com/u/Test_Test)\
**Post date:** [January 27, 2022, 12:00pm UTC](https://community.glideapps.com/t/how-to-obtain-spreadsheetid-and-or-sheet-name-as-a-parameter/37687/11 "2022-01-27T12:00:17Z")

</div>

I was able to solve it by using “contains (case insensitive)” instead of “equals”. Not sure what’s the story here…

* * *

Update:  
So the above solution seemed dodgy (at best) from the start so I kept on digging. As it seems, we need to first “stringify” a parameter using the “Compose sting” tool. Than we filter against that composted string (=Text) and viola… works 🙂

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [January 28, 2022, 12:01pm UTC](https://community.glideapps.com/t/how-to-obtain-spreadsheetid-and-or-sheet-name-as-a-parameter/37687/12 "2022-01-28T12:01:07Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
