Only Show Locations to Clock In if not already Clocked in.

Hi Community,

I've been reading for a few months now - great group of people here by the looks of it.

I have hit a challenge in AppSheet that I just cannot get my head around. I have 3 tables that relate to this issue: TIMESHEET, SITES and EMPLOYEES.

I have a Clock IN/OUT feature that adds a new row in the table called "Timesheet" and leaves the [Date/Time Out] field blank to imply the user is 'Clocked In'. This table has a'Ref' to EMPLOYEES table. 

In the TIMESHEET form - I would like to use a 'Valid If' condition to only accept SITES that the current user isn't already 'Clocked IN' to. Or if better to update the dropdown to only include the SITES that the current user ISNT already 'Clocked In' to?

This is what I have in the (Valid if):
NOT(IN([_THISROW].[ID], SELECT(Timesheet[Site], AND([Site] = [_THISROW].[ID], [Name].[Email] = USEREMAIL(), ISBLANK([Date/Time Out])))))

As the TIMESHEET table contains all historical timesheet, A user could have timesheets for that SITE with a completed [Date/Time Out] value. These will need to be ignored in any expression

0 1 56
1 REPLY 1

Based on description so far, you could try a valid_if expression of 

Sites[key column]- (SELECT(Timesheet[Site], AND([Name].[Email] = USEREMAIL(), ISNOTBLANK([Date/Time Out]))) -[_THISROW].[Site])

There could be mismatch in assumed referencing between tables and key column names etc. If the above does not work, please give the names and types of relevant columns in the three tables and referencing relationship between the tables. 

Top Labels in this Space