Hi everyone,
I have a new form in power apps which contains 4 fields.
1- item list //dropdown
4- amount // textbox
2- currency //dropdown
3-date //datepicker
Next I have share point list (Name: Warning_List) which contains: id, items(lookup from different SP list), currency(lookup from different SP list), Date from and Date to column( contains date), threshold amount (contains threshold amount) and message.
When I submit a save button, I want to check all 4 fields in a form in my Warning_List. First check selected item and selected currency, if they match then check selected date is in date from and date to column and then if amount is > threshold amount ,popup warning card with message. If selected item match and currency doesn't match then do nothing and proceed.)
Can someone please tell me how to check more than 2 conditions?
Thanks in advance.
Solved! Go to Solution.
If the Condition only has one action for true and one action for false, use the && operator to change what returns true and false by having more than one condition there.
Example:
If(SomeTrueFalseClause1 && SomeTrueFalseClause2, true,false)
In the above example:
If SomeTrueFalseClause1 or SomeTrueFalseClause2 returns false, it does not matter if one of them returned true - if either are false, the whole If formula will evaluate the false branch - because all it says in the false branch is false, that means the whole If formula itself just returns the boolean false.
On the other hand, if SomeTrueFalseClause1 or SomeTrueFalseClause2 both return true, then the true side is evaluated - in this case, the true side just says true, that means the whole If formula itself just returns the boolean true.
If the Condition has more than two possible actions at nested depth level you would do it like this instead:
If(SomeTrueOrFalseExpression
,
If(SomeLEVEL2TrueOrFalseExpression
,
SomeLEVEL2FormulaWhenTRUE
,
SomeLEVEL2FormulaWhenFALSE
)
,
SomeLevel1FormulaWhenFalse
)
In the above example:
If the SomeTrueOrFalse Expression returns true AND the SomeLEVEL2TrueOrFalseExpression are both true, only then does the SomeLEVEL2FormulaWhenTRUE get evaluated.
On the other hand, if the SomeTrueOrFalse Expression returns false then SomeLevel1FormulaWhenFalse is the one that gets evaluated.
You can apply either of the above, or even both simultaneously, to your scenario as you see fit. While you can go as complex as you want with the nested If statements, recommend you only keep them to the minimum needed to achieve the objective, only because they may become hard to maintain. If possible, try to indent it and place the commas and parentheses in that kind of specific way we did in the example as well so you could keep track of them more easily if and when you must use the nested conditions.
If the Condition only has one action for true and one action for false, use the && operator to change what returns true and false by having more than one condition there.
Example:
If(SomeTrueFalseClause1 && SomeTrueFalseClause2, true,false)
In the above example:
If SomeTrueFalseClause1 or SomeTrueFalseClause2 returns false, it does not matter if one of them returned true - if either are false, the whole If formula will evaluate the false branch - because all it says in the false branch is false, that means the whole If formula itself just returns the boolean false.
On the other hand, if SomeTrueFalseClause1 or SomeTrueFalseClause2 both return true, then the true side is evaluated - in this case, the true side just says true, that means the whole If formula itself just returns the boolean true.
If the Condition has more than two possible actions at nested depth level you would do it like this instead:
If(SomeTrueOrFalseExpression
,
If(SomeLEVEL2TrueOrFalseExpression
,
SomeLEVEL2FormulaWhenTRUE
,
SomeLEVEL2FormulaWhenFALSE
)
,
SomeLevel1FormulaWhenFalse
)
In the above example:
If the SomeTrueOrFalse Expression returns true AND the SomeLEVEL2TrueOrFalseExpression are both true, only then does the SomeLEVEL2FormulaWhenTRUE get evaluated.
On the other hand, if the SomeTrueOrFalse Expression returns false then SomeLevel1FormulaWhenFalse is the one that gets evaluated.
You can apply either of the above, or even both simultaneously, to your scenario as you see fit. While you can go as complex as you want with the nested If statements, recommend you only keep them to the minimum needed to achieve the objective, only because they may become hard to maintain. If possible, try to indent it and place the commas and parentheses in that kind of specific way we did in the example as well so you could keep track of them more easily if and when you must use the nested conditions.
Thank you for your response. Appreciate your help
User | Count |
---|---|
124 | |
87 | |
86 | |
75 | |
69 |
User | Count |
---|---|
214 | |
181 | |
140 | |
96 | |
83 |