I'm trying to auto-populate a field using yesterday's date. I'm conducting a survey where we check a product twice. Once on a date and then the next day we recheck the product for differences. I have a select_one (${date_choice}) with two options, wakeup and holdover, and two date fields, a wakeup date (the first date) and a holdover date (next day).
I'm trying to auto-populate the wakeup date field, ${date_wake}, so that it populates today or yesterday based on the datechoice chosen. I can't find an easy option for yesterday, but I got to the expression below. I ran into a dependency cycle error and don't know what else to try. Can anyone help?
if(selected(${date_choice}, 'wakeup'), today(), if(selected(${date_choice}, 'holdover'), ${date_wake}<today(), 0))