How can I use ‘when’ to show a toggle field when for example a date field or a users field is not empty? The example underneath doesn’t work.
fields:
date:
label: Date
type: date
time: true
showdate:
label: Show date
type: toggle
when:
date: true
icon: calendar
In the code reference it says about e.g. the users field: ‘Conditions when the field will be shown (since 3.1.0)’. But doesn’t give any examples, would be nice if it did?
I would think its because a date feild is never true or false, it either has a value or it doesnt. The when will toggle it when that value matches (ie, the date field has a specific date and time in it).
The date field is the one field thats a bit tricky. It doesnt have be a true/false type thing. You can do it on a select field for example, on the value of the select. With a date field, there are billions of possible entries, so its hard to know what the value might be in order to set the “when”. I think eventually (but probably not soon) the conditional fields will be able to detect a date between a set range or something.