Hi @Jitesh1432 ,
You can try using a different approach. Instead of embedding this complex logic directly in the Item property of the dropdown, you can use variables and a clearer structure. Here's how you can modify your approach:
Create Variables:
Create two variables to store the selected dates from DatePicker1 and DatePicker2. Let's call them `SelectedDate1` and `SelectedDate2`. Set these variables when the DatePickers are selected.
Set(SelectedDate1, DatePicker1.SelectedDate);
Set(SelectedDate2, DatePicker2.SelectedDate);
Dropdown Item Property:
In the Item property of your dropdown, use a formula that checks the variables `SelectedDate1` and `SelectedDate2` to determine the dropdown items.
If(
IsBlank(SelectedDate1) && IsBlank(SelectedDate2),
["Partially Received", "Not Received"],
["Received"]
)
To handle the initial state correctly, ensure that the `SelectedDate1` and `SelectedDate2` variables are set when the gallery item is created. You can set them based on the initial values of the DatePickers or use the Defaults function.
For example, if you want to set `SelectedDate1` and `SelectedDate2` based on the initial values of DatePickers:
Set(
SelectedDate1,
If(IsBlank(ThisItem.DatePicker1), Defaults(DatePicker1).SelectedDate, ThisItem.DatePicker1.SelectedDate)
);
Set(
SelectedDate2,
If(IsBlank(ThisItem.DatePicker2), Defaults(DatePicker2).SelectedDate, ThisItem.DatePicker2.SelectedDate)
);
Thanks!!!
Please consider marking my response as the accepted solution if it successfully resolves your concern. If you found the information beneficial in other aspects, kindly express your appreciation by giving it a thumbs-up.