Show action based on the time of day

Hi community,

I am trying to hide an action based on time of day.

Not sure how to do this?

TIMENOW() > CONCATENATE(TODAY()," “,RIGHT(SPLIT(“11:00”,” "),13))

I tried this but it gave me an input error.

How do I compare the current time to a specified time of day?

Hi @Quality_Assuran

What about this?

TIMENOW() 
> 
(TODAY()+"011:00:00")

For reference:

Date and time expressions

And here is an excellent Tip from @Joseph_Seddik :

The notions of TIME and DURATION and how to use in expressions

1 Like

Hi guys, I was looking to do something similar to the posted question here…

I read the linked post above also, but it doesn’t seem to be working for me.

I want to make an action unavailable (I don’t care if its hidden or if it just won’t let my crew tap it twice in a day) but I may be misunderstanding how.

Here’s my expression thus far:

AND(OR(CONTAINS([Status], “N/A”),ISBLANK([Status])),ISBLANK([Detail]),[Last Action]<>TIMENOW()-“008.00:00:00”)

I took that to mean that if a user tried to click the action again, but the “last action” was within the last work day, it would not allow it…

Hi @Ryan_Wagner

“I took that to mean that if a user tried to click the action again, but the “last action” was within the last work day, it would not allow it…”

What about this?

AND(
  OR(
    CONTAINS([Status], "N/A"),
    ISBLANK([Status])
  ),
  ISBLANK([Detail]),
  [Last Action]<>WORKDAY(TODAY(), -1)
)

The last part of this expression should be adapted depending on [Last Action] column type. Basically, I consider it here as a Date Type.

@Quality_Assuran did my previous answer solve your situation ?

For reference:

WORKDAY() - AppSheet Help

3 Likes

Thanks for taking a look! Yes, the “Last Action” column type is Date Time.

I tried the expression you gave, and for whatever reason it still isn’t working…

I can’t figure out what the issue is. It seems like it should be a really straightforward solution.

1 Like

Probably because I made a mistake in my suggestion: I put a <> instead of just >.

Should be:

AND(
  OR(
    CONTAINS([Status], "N/A"),
    ISBLANK([Status])
  ),
  ISBLANK([Detail]),
  [Last Action]>WORKDAY(TODAY(), -1)
)

Do that solve your situation ?

2 Likes

I believe that did it! Ironically, I will have to wait til tomorrow to know for sure, based on the expression…

Thank you very much. This will be a big help.

2 Likes

" I will have to wait til tomorrow to know for sure, based on the expression…"

Can you try with this, if you are in a hurry :wink:

AND(
  OR(
    CONTAINS([Status], "N/A"),
    ISBLANK([Status])
  ),
  ISBLANK([Detail]),
  [Last Action]>WORKDAY(TODAY(), -1) -1
)

(I just added a “-1”)

3 Likes

Sorry for the delay. You definitely solved it for me. If this was my post, I would mark it as solved, but I hijacked it for my own purposes…

Thanks again.

2 Likes

You may need to mark one as solution if that answered your question, as it may help someone else asking for the same question :wink:

3 Likes

It looks like I don’t have that option, maybe because I didn’t start the thread. But I would have called it solved…Thanks again.

2 Likes

Haha correct, I didn’t even notice that. @Quality_Assuran , is your question solved ?

1 Like

@Aurelien , sorry haven’t had a chance to try it till now. But it is working. Thanks very much!

2 Likes