Stopping entries if blank (clock-out)

Hey, wonder if anyone can help with this. I’m trying to prevent employees that have not clocked out from creating a new entry (ie. clock-in again)

The weird thing is that it was working yesterday, but something changed and I can’t figure out why it stopped working. Below is the code for the valid_if field under [Employee_Number], a required field. IDK why it doesn’t work :frowning:

AND(
  IN([_THIS], Employees[ID]),
  COUNT(
    SELECT(Attendance[Row_ID],
      AND(
        [Employee_Number] = [_THISROW].[Employee_Number],
        ISBLANK([End_Time])
      )
    )
  ) = 0
)


Try this?

AND(
  IN([_THIS], Employees[ID]),
  COUNT(
    SELECT(Attendance[Row_ID],
      AND(
        ISBNOTLANK([Employee_Number]),
        [Employee_Number] = [_THISROW].[Employee_Number],
        ISBLANK([End_Time])
      )
    )
  ) = 0
)

If it works, there’s an entry in the Attendance table with a blank Employee_Number column value that probably shouldn’t be there.

Turns out it wasn’t a problem with the code. It was because the “show?” had a formula which hid the field by mistake… lol

Hi @Benjamin_Quek

If you want to hide the input form, maybe in the slice (table slice) you can add a formula like this (this is just an example):

NOT(IN(TEXT(NOW(),“HH”),LIST(“19”,“20”,“21”,“22”,“23”,“00”,“01”,“02”,“03”,“04”,“05”,“06”))))

data does not appear starting from the hour : 19:00 to 06:59

not given a formula in the slice