Good afternoon everyone!
I've created a PTO app, and I'm trying to set some conditions. One of the conditions is that if the user selects "Holiday", then they can only request one day. I have tried two different methods to add this to my app, and neither are working. The first was to create a variable called OnlyOneHoliday and set it to true, and a condition of if holiday was chosen and the date total was greater than 1 it would set the variable to false, and the displaymode properties for my Next button would include that OnlyOneHoliday had to be true. This was the formula I came up with -
Set(OnlyOneHoliday,true);
If((DataCardValue22.Selected.Value = "Holiday") && (PTODateTotal > 1), OnlyOneHoliday = false, OnlyOneHoliday = true)
However, no matter what choices I make it always returns OnlyOneHoliday as true. Is there something I'm missing? Below is the current code for my Next button condition, if it's just easier to add something to that then I'm all ears.
If(!IsBlankOrError(DataCardValue22.Selected) && !IsBlankOrError(DatePickerStartDate.SelectedDate) && !IsBlankOrError(DatePickerEndDate.SelectedDate) && PTODateTotal <= SelectedTimeOffAvailableDays && DatePickerEndDate.SelectedDate >= DatePickerStartDate.SelectedDate && OnlyOneHoliday = true,DisplayMode.Edit,DisplayMode.Disabled)
Thanks in advance for any assistance!