Hello,
I had a function like that:
(CountRows(Gallery2.Selected.WhoLikedPeople) = 0,"Brak polubień","Zobacz listę (" & CountRows(Gallery2.Selected.WhoLikedPeople) &")")
It worked flawlessly showing either "No results - Brak polubień" and "Check list - X amount - Zobacz listę X)
but I need to change it to work conditionally:
If(varTop,CountRows(Gallery2.Selected.WhoLikedPeople) = 0,"Brak polubień","Zobacz listę (" & CountRows(Gallery2.Selected.WhoLikedPeople) &")",CountRows(Gallery3.Selected.WhoLikedPeople) = 0,"Brak polubień","Zobacz listę (" & CountRows(Gallery3.Selected.WhoLikedPeople) &")")
I want to execute it based on variable varTop (true/false) but I receive errors:
Invalid argument type Text expecting a Boolean.
Function if has invalid argument.
Basicly I want to execute this if varTop is true:
(CountRows(Gallery2.Selected.WhoLikedPeople) = 0,"Brak polubień","Zobacz listę (" & CountRows(Gallery2.Selected.WhoLikedPeople) &")")
and this if it is false:
(CountRows(Gallery3.Selected.WhoLikedPeople) = 0,"Brak polubień","Zobacz listę (" & CountRows(Gallery3.Selected.WhoLikedPeople) &")")
This function is on label.
Please advise what should I do.
Solved! Go to Solution.
Hi @Elitezone
I think you just need to nest your if statements like so...
If(varTop,
If(CountRows(Gallery2.Selected.WhoLikedPeople) = 0,
"Brak polubień",
"Zobacz listę (" & CountRows(Gallery2.Selected.WhoLikedPeople) &")"
),
If(CountRows(Gallery3.Selected.WhoLikedPeople) = 0,
"Brak polubień",
"Zobacz listę (" & CountRows(Gallery3.Selected.WhoLikedPeople) &")"
)
)
Hi @Elitezone
I think you just need to nest your if statements like so...
If(varTop,
If(CountRows(Gallery2.Selected.WhoLikedPeople) = 0,
"Brak polubień",
"Zobacz listę (" & CountRows(Gallery2.Selected.WhoLikedPeople) &")"
),
If(CountRows(Gallery3.Selected.WhoLikedPeople) = 0,
"Brak polubień",
"Zobacz listę (" & CountRows(Gallery3.Selected.WhoLikedPeople) &")"
)
)
Check out new user group experience and if you are a leader please create your group
Did you miss the call?? Check out the Power Apps Community Call here!
See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.
User | Count |
---|---|
270 | |
252 | |
86 | |
37 | |
33 |
User | Count |
---|---|
343 | |
263 | |
129 | |
68 | |
45 |