In Excel, if you want to use multiple IF statements, it would go like this:
IF(A=B, value if true, value if false), IF(C=D, value if true, value if false), IF(E=F, value if true, value if false)
In PowerApps, you don't have to use "IF" the second and third time:
IF(A=B, value if true, value if false), (C=D, value if true, value if false), (E=F, value if true, value if false)
I'm looking to start with two "IF" statements, and then add a "IF(AND)" statement, which is simple in Excel:
IF(A=B, value if true, value if false), IF(C=D, value if true, value if false), IF(AND(E=F, G=H, value if true, value if false))
But I can't make it work in PowerApps because that I can't use that third "IF". If I just use "AND" it doesn't work.
There has got to be a simple solution to this but I can't find it anywhere.
Solved! Go to Solution.
Hi Hugh,
A couple solutions here: (very bad example, but highlights how to nest the 'And' statements)
Set(a, 1); Set(b, 2); Set(c, 3); If(And(And(a = b, b = c), c = a), Do stuff, else do other stuff)
and then, as your logic grows, it may be easier for you to use && in place of 'And' like so:
Set(a, 1); Set(b, 2); Set(c, 3); If(a = b && b = c && c = a, Do stuff, else do other stuff)
Hi Hugh,
A couple solutions here: (very bad example, but highlights how to nest the 'And' statements)
Set(a, 1); Set(b, 2); Set(c, 3); If(And(And(a = b, b = c), c = a), Do stuff, else do other stuff)
and then, as your logic grows, it may be easier for you to use && in place of 'And' like so:
Set(a, 1); Set(b, 2); Set(c, 3); If(a = b && b = c && c = a, Do stuff, else do other stuff)
I knew there was a simple solution that I was missing!
Thanks so much.
Makes perfect sense.
HI @C_Ian_Davis
Can you help me with my formula? i want to make the gallery visible with 2 OR condition TRUE.
If(GalleryTabInspection.Selected.Value.ID = "MenuTab2", Or(CountRows(Filter(HeaderColl, SO_Number=GalleryFilterSO.Selected.'Service Order Id'))=0), false, true)
It doesnt seem work like i expected.
What should i do to make it work properly?
Thanks,
pytbyt
Is it possible to perform If(true, do stuff and other stuffs, else)?
I tried to use like If(true, and(do stuff, other stuffs), else) but it does not help.
It seems 'and' can be used only for comparision.
Hope to hear from you soon.
Yes it is possible to perform multiple stuff If True, - using "&"
here is the example code which I'm using
I'm running this code in OnChange event of Dropdown1
If (
Dropdown1.Selected.Value = "Edit",
Reset(Dropdown1) &
EditForm(formuserinfo) &
Set(
visformuserinfo,
true
) &
Set(
grpfrmsubmit,
true
),
Reset(Dropdown1)
)
User | Count |
---|---|
157 | |
93 | |
80 | |
74 | |
57 |
User | Count |
---|---|
201 | |
166 | |
98 | |
94 | |
79 |