In the form below, I want the Update button to be disabled when the Cancelled or Rejected is selected from Request Status and if the Cancellation/Rejection Reason field is empty
Below is the formula I have. Each If statement works independently but when I combine them together, it doesn't work. Any ideas?
If(
IsBlank(DataCardValue25.SelectedItems) && DataCardValue1.Selected.Value = "In Progress",
DisplayMode.Disabled,
DisplayMode.Edit,
If(
(DataCardValue1.Selected.Value = "Cancelled" && IsBlank(DataCardValue48.Text)) || (DataCardValue1.Selected.Value = "Rejected" && IsBlank(DataCardValue47.Text)),
DisplayMode.Disabled,
DisplayMode.Edit
)
)
Thanks!
Solved! Go to Solution.
You typically do not need an If() inside another If(). If() inPowerApps works like this
If( Condition1, ThenResult1 [, Condition2, ThenResult2, ... [ , DefaultResult ] ] )
So try rewriting your code like this
If(
// Condition 1
IsBlank(DataCardValue25.SelectedItems) && DataCardValue1.Selected.Value = "In Progress",
// ThenResult 1
DisplayMode.Disabled,
// Condition 2
(DataCardValue1.Selected.Value = "Cancelled" && IsBlank(DataCardValue48.Text)) || (DataCardValue1.Selected.Value = "Rejected" && IsBlank(DataCardValue47.Text)),
// ThenResult 2
DisplayMode.Disabled,
// Default Result
DisplayMode.Edit
)
You typically do not need an If() inside another If(). If() inPowerApps works like this
If( Condition1, ThenResult1 [, Condition2, ThenResult2, ... [ , DefaultResult ] ] )
So try rewriting your code like this
If(
// Condition 1
IsBlank(DataCardValue25.SelectedItems) && DataCardValue1.Selected.Value = "In Progress",
// ThenResult 1
DisplayMode.Disabled,
// Condition 2
(DataCardValue1.Selected.Value = "Cancelled" && IsBlank(DataCardValue48.Text)) || (DataCardValue1.Selected.Value = "Rejected" && IsBlank(DataCardValue47.Text)),
// ThenResult 2
DisplayMode.Disabled,
// Default Result
DisplayMode.Edit
)
Thank you! That worked!
User | Count |
---|---|
262 | |
110 | |
92 | |
54 | |
43 |