Hi All, Onchange properties on my dropdown if you selected "N/A" UpdateContext({varCalculationActive1: false}) and when you select "Paid" UpdateContext({varCalculationActive1: true}), now i want automatic change my dropdown to N/A and my number of days should be zero and disabled all the Paid leave fields, if the Value of Remaining leave is zero.
Update : I can now manage to automatic change my dropdown to "N/A" once the remaining leave is zero using the code in my defaultselected item properties and disabled it. but my problem now is my number of days is not changing.
Onchange properties dropdown:
If(
PaidDrop.Selected.Value = "Paid",
UpdateContext({varCalculationActive1: true}) || PaidDrop.Selected.Value = "N/A",
UpdateContext({varCalculationActive1: false})
)
DefaultSelectedItem:
If(
Leavetype.Selected.Value = "Paternity leave" && Value(TextInput1_12.Text) = 0 || Leavetype.Selected.Value = "Vacation Leave" && Value(TextInput1_9.Text) = 0 || Leavetype.Selected.Value = "Sick Leave" && Value(TextInput1_9.Text) = 0 || Leavetype.Selected.Value = "Emergency Leave" && Value(TextInput1_9.Text) = 0 || Leavetype.Selected.Value = "Maternity leave" && Value(TextInput1_21.Text) = 0 || Leavetype.Selected.Value = "Bereavement Leave" && Value(TextInput1_24.Text) = 0 || Leavetype.Selected.Value = "Leave for Victim of Violence (Women&Children)" && Value(TextInput1_27.Text) = 0 || Leavetype.Selected.Value = "Parental Leave for Solo Parent" && Value(TextInput1_18.Text) = 0 || Leavetype.Selected.Value = "Special Leave for Women" && Value(TextInput1_30.Text),
Table({Value: "N/A"}),
Table({Value: "Paid"})
)
number of days
If(varCalculationActive1,
If(
Leavetype.Selected.Value = "Maternity leave",
If(
StartDates.SelectedDate <= EndDates.SelectedDate,
DateDiff(
StartDates.SelectedDate,
EndDates.SelectedDate,
Days
) + 1 - If(
Checkbox3.Value,
0.5
)
),
(If(
StartDates.SelectedDate = EndDates.SelectedDate,
Sum(
If(
Weekday(StartDates.SelectedDate) = 1,
0,
1
)
) - If(
Checkbox3.Value,
0.5
),
If(
StartDates.SelectedDate > EndDates.SelectedDate,
-Sum(
ForAll(
Sequence(
DateDiff(
EndDates.SelectedDate,
StartDates.SelectedDate,
Days
),
0,
1
),
If(
Weekday(
DateAdd(
EndDates.SelectedDate,
Value
)
) = 1,
{DayCount: 0},
{DayCount: 1}
)
),
DayCount
) - If(
Checkbox3.Value = false,
0.5
) - 1/2,
Sum(
ForAll(
Sequence(
DateDiff(
StartDates.SelectedDate,
EndDates.SelectedDate,
Days
),
0,
1
),
If(
Weekday(
DateAdd(
StartDates.SelectedDate,
Value
)
) = 1,
{DayCount: 0},
{DayCount: 1}
)
),
DayCount
) + If(
Checkbox3.Value = false,
0.5
) + 1 / 2
) - CountRows(
Filter(
colHolidays,
HolidayDates >= StartDates.SelectedDate,
HolidayDates <= EndDates.SelectedDate
)
)
))
)
)

Can you help me with this? Thank you