Hi, I really need your help on how can I combine these two conditions in PowerApps DisplayMode. I tried to combine these two (refer no 2 in the screenshot), and it returns no error but when I published my app, the button cannot be clicked and saved the data. Really appreciate your help
Condition 1: If(DataCardValue38.Text="Not Processed",DisplayMode.Disabled,DisplayMode.Edit)
Condition 2: If(And(IsBlank(Datefrom.SelectedDate) || IsBlank(DataCardValue34.SelectedItems.DisplayName) || IsBlank(DataCardValue35.SelectedItems.DisplayName)),Disabled)
Solved! Go to Solution.
I would try this
If(
DataCardValue38.Text="Not Processed",
DisplayMode.Disabled,
If(And(IsBlank(Datefrom.SelectedDate) || IsBlank(DataCardValue34.SelectedItems.DisplayName) || IsBlank(DataCardValue35.SelectedItems.DisplayName)),
Disabled,
Edit)
)
I would try this
If(
DataCardValue38.Text="Not Processed",
DisplayMode.Disabled,
If(And(IsBlank(Datefrom.SelectedDate) || IsBlank(DataCardValue34.SelectedItems.DisplayName) || IsBlank(DataCardValue35.SelectedItems.DisplayName)),
Disabled,
Edit)
)
Hi @Nbz78,
Do you want to disable the button when either of the condition is met or both of them are met?
I think your issue is related to the validation of the DataCardValue34.SelectedItems and DataCardValue35.SelectedItems.
Since SelectedItems is a Table value, you should use the IsEmpty() function instead of the IsBlank() function.
If you want to disable the button once either of the condition is met:
If(
DataCardValue38.Text="Not Processed" ||
(And(IsBlank(Datefrom.SelectedDate) || IsEmpty(DataCardValue34.SelectedItems.DisplayName) || IsEmpty(DataCardValue35.SelectedItems.DisplayName)),
Disabled,
Edit)
)
If you want to disable the button once both of the conditions are met:
If(
DataCardValue38.Text="Not Processed" &&
(And(IsBlank(Datefrom.SelectedDate) || IsEmpty(DataCardValue34.SelectedItems.DisplayName) || IsEmpty(DataCardValue35.SelectedItems.DisplayName)),
Disabled,
Edit)
)
Hi thank you for your help! 🙂 I tried your code and everything seems good. Will let you know if I encounter any issues on this
Thanks for helping!