# Set a timer for a TAB

**URL:** <https://community.glideapps.com/t/set-a-timer-for-a-tab/17899>\
**Category:** Ask for Help\
**Created:** [November 3, 2020, 3:16pm UTC](https://community.glideapps.com/t/set-a-timer-for-a-tab/17899 "2020-11-03T15:16:00Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amal](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/amal/32/15421_2.png) [@Amal](https://community.glideapps.com/u/Amal)\
**Post date:** [November 3, 2020, 3:16pm UTC](https://community.glideapps.com/t/set-a-timer-for-a-tab/17899/1 "2020-11-03T15:16:00Z")

</div>

Hi,

Since there is no way to tracking if a button is pressed in glide and opening a link at the same time ( for now) I wanted to have a install app tab, where there is a welcome message and a download button to my apk file, however there is no way for me to capture the click and then move to the next screen, whist hiding the install tab. My alternative to this is having a 30 sec timer that gets triggered on user opening the app ( splash screen-like)

---

<div class="post-metadata">

**Author:** ![Amal](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/amal/32/15421_2.png) [@Amal](https://community.glideapps.com/u/Amal)\
**Post date:** [November 4, 2020, 10:52am UTC](https://community.glideapps.com/t/set-a-timer-for-a-tab/17899/2 "2020-11-04T10:52:09Z")

</div>

Up, someone please help with this @ThinhDinh any suggestion?

---

<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:** [November 4, 2020, 2:30pm UTC](https://community.glideapps.com/t/set-a-timer-for-a-tab/17899/3 "2020-11-04T14:30:50Z")

</div>

So you want the download button to trigger a tab visibility condition?

---

<div class="post-metadata">

**Author:** ![Amal](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/amal/32/15421_2.png) [@Amal](https://community.glideapps.com/u/Amal)\
**Post date:** [November 4, 2020, 3:01pm UTC](https://community.glideapps.com/t/set-a-timer-for-a-tab/17899/4 "2020-11-04T15:01:15Z")

</div>

the download button has a apk file linked to it, on clicking it user downloads my glide app as a apk.

But after that i want the tab to disappear.

---

<div class="post-metadata">

**Author:** ![kingzy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/kingzy/32/15690_2.png) [@kingzy](https://community.glideapps.com/u/kingzy)\
**Post date:** [November 4, 2020, 3:50pm UTC](https://community.glideapps.com/t/set-a-timer-for-a-tab/17899/5 "2020-11-04T15:50:49Z")

</div>

You can set a true/false condition with a timer based off the users registration time.  
The button can disappear after x minutes.

---

<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:** [November 4, 2020, 3:52pm UTC](https://community.glideapps.com/t/set-a-timer-for-a-tab/17899/6 "2020-11-04T15:52:56Z")

</div>

So if the user has downloaded the app, the tab disappears and vice versa?

---

<div class="post-metadata">

**Author:** ![Amal](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/amal/32/15421_2.png) [@Amal](https://community.glideapps.com/u/Amal)\
**Post date:** [November 4, 2020, 9:21pm UTC](https://community.glideapps.com/t/set-a-timer-for-a-tab/17899/7 "2020-11-04T21:21:32Z")

</div>

yes, either by having a timer set or some way of knowing user clicked the button

---

<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:** [November 4, 2020, 10:11pm UTC](https://community.glideapps.com/t/set-a-timer-for-a-tab/17899/8 "2020-11-04T22:11:06Z")

</div>

Gotta wait for the compound action then. Increment a column + open link action.

---

<div class="post-metadata">

**Author:** ![Amal](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/amal/32/15421_2.png) [@Amal](https://community.glideapps.com/u/Amal)\
**Post date:** [November 4, 2020, 10:28pm UTC](https://community.glideapps.com/t/set-a-timer-for-a-tab/17899/9 "2020-11-04T22:28:10Z")

</div>

yea i guess so, waiting for it to come out of staging

---

<div class="post-metadata">

**Author:** ![Amal](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/amal/32/15421_2.png) [@Amal](https://community.glideapps.com/u/Amal)\
**Post date:** [November 5, 2020, 7:45am UTC](https://community.glideapps.com/t/set-a-timer-for-a-tab/17899/10 "2020-11-05T07:45:48Z")

</div>

How can i get the timestamp from user login? the App: Logins does not shop up in glide. How to capture the time?

---

<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:** [November 5, 2020, 7:47am UTC](https://community.glideapps.com/t/set-a-timer-for-a-tab/17899/11 "2020-11-05T07:47:19Z")

</div>

You can create a column in your user profiles sheet and use an arrayformula to bring it over.

---

<div class="post-metadata">

**Author:** ![Amal](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/amal/32/15421_2.png) [@Amal](https://community.glideapps.com/u/Amal)\
**Post date:** [November 5, 2020, 7:49am UTC](https://community.glideapps.com/t/set-a-timer-for-a-tab/17899/12 "2020-11-05T07:49:39Z")

</div>

just to be on the safe side, is there a formula i can use that will lookup the App:Logins time and email and match it with email on my users sheet, rather than just using arrayformula?

---

<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:** [November 5, 2020, 9:13am UTC](https://community.glideapps.com/t/set-a-timer-for-a-tab/17899/13 "2020-11-05T09:13:11Z")

</div>

I’ve found that a query function is ideal for this:

`=QUERY({'App: Logins'!A1:A}, "SELECT * WHERE Col1 <> ''",FALSE)`

---

<div class="post-metadata">

**Author:** ![Amal](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/amal/32/15421_2.png) [@Amal](https://community.glideapps.com/u/Amal)\
**Post date:** [November 5, 2020, 9:35am UTC](https://community.glideapps.com/t/set-a-timer-for-a-tab/17899/14 "2020-11-05T09:35:18Z")

</div>

Thnx for this, but may i ask, how is this diffrent from arrayformula?

---

<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:** [November 5, 2020, 9:41am UTC](https://community.glideapps.com/t/set-a-timer-for-a-tab/17899/15 "2020-11-05T09:41:40Z")

</div>

Sorry, it’s not really. I was actually replying to @ThinhDinh.  
To do what you want, I think I would probably write a custom trigger function.  
If you show me what your sheet structure looks like, I could knock up an example for you.

---

<div class="post-metadata">

**Author:** ![Amal](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/amal/32/15421_2.png) [@Amal](https://community.glideapps.com/u/Amal)\
**Post date:** [November 5, 2020, 10:02am UTC](https://community.glideapps.com/t/set-a-timer-for-a-tab/17899/16 "2020-11-05T10:02:31Z")

</div>

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/1/8/189da092f68d41ef54f905287537bac76ab25bba.png)

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/0/7026599f1ceb62f60c6f3d24b0bd44d4d9912766.png)

---

<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:** [November 5, 2020, 10:10am UTC](https://community.glideapps.com/t/set-a-timer-for-a-tab/17899/17 "2020-11-05T10:10:46Z")

</div>

Okay, so you’d like to make a copy of each row in your `App:Logins` sheet, but only if the email address exists in your `Users` sheet. Is that correct?

---

<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:** [November 5, 2020, 11:16am UTC](https://community.glideapps.com/t/set-a-timer-for-a-tab/17899/18 "2020-11-05T11:16:35Z")

</div>

Something like this would do it:

```
function on_sheet_change(event) {
  var sheetname = event.source.getActiveSheet().getName();
  if (sheetname == 'App:Logins') {
    var sheet = event.source.getActiveSheet();
    var new_login = sheet.getRange(sheet.getLastRow(),1,1,2).getValues();
    check_add_user_login(new_login);
  }
}

function check_add_user_login(new_login) {
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var user_sheet = ss.getSheetByName('Users');
  var valid_emails = user_sheet.getRange(2,1,user_sheet.getLastRow()-1).getValues();
  var logged_in_user = new_login[0][1];
  valid_emails.forEach(function (email) {
    if (email == logged_in_user) {
      var sheet = ss.getSheetByName('User Logins');
      sheet.getRange(sheet.getLastRow()+1,1,1,2).setValues(new_login);
      return;
    }
  });
}

```

You could add that as a trigger function to run whenever there is an `ON_CHANGE` event, ie:

 ![Screen Shot 2020-11-05 at 7.11.27 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/4/5/45f2dbf1ecb50b9aa494542e4d57bda92aad6710.png)

The logic is that whenever a row is added to your `App:Logins` sheet, it will check the email address to see if it matches any of those in your `Users` sheet. If it does, it will write a new row to the `User Logins` sheet. If you need it written elsewhere, then just adjust accordingly.

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [November 5, 2020, 12:55pm UTC](https://community.glideapps.com/t/set-a-timer-for-a-tab/17899/19 "2020-11-05T12:55:00Z")

</div>

An array formula with a VLOOKUP should do it if you want to match the user profile email to the app: logins email. The question is, do you need the first initial timestamp, or the timestamp of the last time they signed in?

Also be aware that I think glide stores the timestamps in the app logins sheet as a string, so you may need to pick it apart into a date.

Also if row count isn’t a concern, you could duplicate the sheet with a new name, so it’s visible writing the glide data editor.
