Help needed with Date Picker

I’m wanting a user to be able to change the day on the Date Picker and either be able to “Add a Day” or “Delete a Day” based off of whether an event has been recorded that day or not.

However, I can’t get the buttons to appear or disappear based off of the rules I’ve listed below.

Rules for Add Button

Rules for Delete Button

Currently that the Add button always remains and the Delete button never appears (even if the date is already recorded).

Is there something special that I need to do with the date picker?

Hi @Michael,

Datepicker will not help here from my point of view.

What I could suggest - you need to set visibility rules based on the number of records in the collection which have “Current day” as one of the properties.
E.g.:
Say, you have collection called “Events”.
For “Add” button you create a visibility rule, if Count of Events where Date = current day, is equal to 0.
For “Delete” button - in order to be able to remove the record, you convert this button to a list of Events filtered by selected day (the one from datepicker for example). As a consequence, no events → no list entries; event exist → one list entry.

You can have a look at this video Adalo hints: how to create one single record for a one single date in a collection - YouTube, there is similar case explained there.

Best regards, Victor.

1 Like