Conditional Control From Save Button

How to write this expression ton control the input form in 2 conditions as follows.......
Condition 1 :-
1. Col G Initial Value now() in SCAN IN table. The input time range on the form is valid_if between 7am ~ 21pm reference to now() time at column G.
2. The shift code in Employee table has to be 11.

Condition 2 :-
1. Col G Initial Value now() in SCAN IN table. The input from the form is valid_if between 19pm ~ 7am (next day) reference to now() time at column G.
2. The shift code in Employee table has to be 12.

desmond_lee_0-1658289393678.png

 

Solved Solved
0 8 218
2 ACCEPTED SOLUTIONS

My expression does not work in your app.

Within your LOOKUP, a comma is missing between "EMPLOYEE" and "EMPLOYEE ID".

TeeSee1_0-1658301626069.png

EDITED,

There is also a missing comma in my post...

View solution in original post

Thanks Teesee

I have a another way to get around in the below expression.

CONCATENATE(DATE([TIMSTAMP IN]), ", ",IF([SHIFT CODE]=11, IF(TIME([TIMSTAMP IN])<"16:30:00", "07:00:00",TIMENOW()),IF([SHIFT CODE]=12,IF(TIME([TIMSTAMP IN])<"16:30:00", "08:00:00",TIMENOW()), "")))

View solution in original post

8 REPLIES 8

You can try the expression below (please adjust the col/variable names/comparison conditions to fit your definition/needs)

 

SWITCH(
 LOOKUP(
  [_THISROW].[Emp Code],
  "emp table"
  "emp code",
  "shift id"
 ),
 11,
 AND(
  START TIME < [CLOCK IN],
  [CLOCK IN] < END TIME
 ),
 12,
 AND(
  START TIME < [CLOCK IN],
  [CLOCK IN] < END TIME
 ),
 FALSE
)
 

 

 

Thank very for replying. I have try but it shows this msg

desmond_lee_0-1658298967281.png

 

A comma missing

Hi Tee

I copy and paste exact its already shows that same msg. Couldn't spot where is that comma. Don't mind to tell me? Thank very much

desmond_lee_0-1658301059905.png

 

My expression does not work in your app.

Within your LOOKUP, a comma is missing between "EMPLOYEE" and "EMPLOYEE ID".

TeeSee1_0-1658301626069.png

EDITED,

There is also a missing comma in my post...

Hi See

That error msg resolve but this error pops up

SWITCH(LOOKUP([_THISROW].[EMPLOYEE ID],"EMPLOYEE","EMPLOYEE ID","SHIFT CODE"),11,AND(START TIME < [TIMESTAMP IN],[TIMESTAMP IN] < END TIME),12,AND(START TIME < [TIMESTAMP IN],[TIMESTAMP IN] < END TIME),FALSE)

desmond_lee_0-1658302525024.png

 

Please read this help doc and adjust time comparison expressions

https://support.google.com/appsheet/answer/10107326?hl=en

Thanks Teesee

I have a another way to get around in the below expression.

CONCATENATE(DATE([TIMSTAMP IN]), ", ",IF([SHIFT CODE]=11, IF(TIME([TIMSTAMP IN])<"16:30:00", "07:00:00",TIMENOW()),IF([SHIFT CODE]=12,IF(TIME([TIMSTAMP IN])<"16:30:00", "08:00:00",TIMENOW()), "")))

Top Labels in this Space