How to change the state of button or text based on date

Hello,

I have a form that the user will fill in. In this form is an expiry date that they must select. What I would like to do with this expiry date. On the details page once this form is submitted. I would like to should it this item is active or expired based on the date that the user entered into the form. So it the current date hasnt passed the expiry date then the item is active. if the current date has passed the expiry date then that item is expired.

Can this be done in adalo?

Regards,

Matthew
Screenshot 2021-06-04 at 21.18.12

Hi,

You can change visibility using date logic. In the picture below, I used a date picker, but you can choose a date from the DB collection (as long as it’s available data for your screen) and build logic based on that.

For reference, you should two text boxes “expired” & “valid”, if date is before, show valid. If date is after, show expired.

Hello,
I have managed to get this working. Thanks for your help.

I have one more question. Would there be a way to get how many items that are Valid or Expired and put this information into a chart? This information isn’t stored in the database.

Depends on how you’re trying to show it. Just a chart with expired vs not expired, with two bars, definitely possible. Anything more sophisticated depends on what you’re trying to achieve.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.