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)
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?
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.
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:
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.
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.