Conditional 'view element' based on a date

Hey Guys,

I am working on something that seems easy. My app is used to help people with attendance and will offer zoom links to certain things based on a date. I want the attendance to show everything but the zoom link but am having a problem making that link conditionally hidden based on date.

2 things:

  1. I see that I can add dates but not subtract days. I want the link to appear 2 days before the date of the current cells object.
  2. It is evaluating out to a date and not a yes/no, well lol, obviously, but, is there any other way to do this? I was thinking of just not showing it on page load and when the condition is true showing it, but I am not sure if it will stay showing after that. just looked again after writing this post and realized that if i did a workflow to it, it might hide the zoom link entirely as it is set in a repeating group. That idea is out of the window lol.

Can anyone help me with this?

You are the best,
Benjamin

Hey Benjamin!

For #1, you can subtract days by providing a negative value to the +days modifier.

I’m not sure what you are looking for in #2… maybe you explain a bit differently?



Looking to accelerate your app development?

Let me turn
:thinking: :tired_face: :confounded:

into
:grinning: :sunglasses: :woman_student:

Development through Coaching at https://uniqueideas.com or schedule a free intro session :gift:

Ken Truesdale
LinkedIn

As for your condition, here’s an example (I can’t guess what exactly you’re trying to check for, so this is just a for example).

Now is:

Current Date/Time

48 hours before now is:

Current Date/Time +(days) -2

Now you have a thing with a date:

Thing’s WhateverDate

48 hours before that is:

Thing’s WhateverDate +(days) -2

Is now within 2 days of WhateverDate?

Thing’s WhateverDate +(days) -2 < Current Date/Time

… holds the answer. That’s a boolean expression. (There’s other ways to write that, too, but you get the idea I think.)

Keep in mind: In expression fields, we can only do math on the left hand side of the expression. That’s why the expression is a lil’ wonky looking. We’d love to write:

Current Date/Time > Thing’s WhateverDate +(days) -2

… which reads much more naturally as “now is after (the point in time that is) two days before WhateverDate”, right?

But unfortunately we cannot. Because once we write “Current Date/Time > Thing’s Whatever Date” the expression field says, “AH, OK that’s a boolean! We done up in here!” This is literally, actually why we cannot continue and put a date type :operator on WhateverDate, like “+(days)”. What we are writing is no longer a date type expression.

Thankfully, as you can see, you can just jot down (in a text editor or notepad or just in your head) the expression the way we wish we could write it, and just flip it around. :wink:

Thank you everyone for the help. It all works now. That was really impressive. I do appreciate the help.

This topic was automatically closed after 70 days. New replies are no longer allowed.