Help needed - employees access

Are these possible?

Options for employees:

  1. Employee login password - each one has his/her own (I know how it with an email address, but I want to add a password as well)
  2. The employee will be able to upload an image only during the set working hours.
  3. The employee will not have access to the application out of office hours.
  4. Delete images from the app 24 hours after uploading them (storage).
  5. make sure images are in high resolution.

Thanks for repaying those

Probably this can be done with a public app. I imagine having a user-specific field for entering password and a template + relation combination to check if the entered email + password is existing in the data.

You can have two fixed time column in the Sheet, let’s say it contains 09:00 and 17:00, then a math column inside Glide with the format set to time only. Show the image picker only when the “now” time is after 09:00 and before 17:00.

Use the same strategy above, don’t show the password field when it’s outside of office hours.

You would need a script to do this, and make sure you catch the timestamp when users upload an image, via a form.

We have no control over this.

1 Like

All are very clear, except:

You would need a script to do this, and make sure you catch the timestamp when users upload an image, via a form.

Any Idea where to find such a script? I guess you mean to delete rows right?

Yes, I would have an arrayformula to calculate a trigger. Something like if original + timestamp > now then true.

Use the trigger on every row that returns a true value.

1 Like

You could actually just use the now function in a cell and format it for time. Then glide did a visibility for the action that will not show the button to add pictures or files if that number is greater or less than.
You would need a script for sure to delete the files but I guess the question is does it need to be 24 hours or just at the end of the day.

Ok, so here’s a script that should work to remove after they are a day old, just change sheet name and column reference.

function ClearAfter24() {
var ssActive = SpreadsheetApp.getActiveSpreadsheet();
    SpreadsheetApp.setActiveSheet(getSheetByName('Sheet1'))
var MyRange = ssActive.getRange("A:A");//selects column A
var ADayAgo = new Date(date.getTime()-(24*3600*1000));
for(i = 0; i < MyRange.length; i++) {
    if(MyRange[i].getTime()<ADayAgo){
        getActiveSheet().deleteRow(i);
    }
}
}

Something else to note, you can just add a multiplier to the beginning of the time identifier to change the day count, a example of this would be if you wanted it to be a week instead of a day the 5th line would simply read:

var ADayAgo = new Date(date.getTime()-7*(24*3600*1000));
3 Likes

Wow, thank you so much guys, super helpful!!

@Drearystate & @ThinhDinh you are the best (:grin:

2 Likes