Hi All
I have a label that i would like to appear based on a condition
so my scenario is
i have to people selection Comboboxes
if they contain duplicate names the label should appear but it is appearing when both fields are empty.
my formula is
If(
DataCardValue8.Selected.DisplayName = DataCardValue7.Selected.DisplayName,true,
IsEmpty(DataCardValue8.Selected.DisplayName = DataCardValue7.Selected.DisplayName),false)
Is my logic flawed?
Help Gratefully received 🙂
Gary
Solved! Go to Solution.
Hi Gary, I got this version to work on a test app - order of operations was biting us:
If(
IsBlank(DataCardValue8.Selected.DisplayName) && IsBlank(DataCardValue7.Selected.DisplayName),
false,
DataCardValue8.Selected.DisplayName = DataCardValue7.Selected.DisplayName,
true,
false
)
Gary, do your combo boxes allow multiple selections? That's the default, and it creates a many-many relationship when you try to compare them. So, a simple "this = that" comparison doesn't work because "this" and "that" are both tables. Any chance you can turn off multiple selections for those, or even one? It would make the situation much easier to solve.
Bryan
Thanks for replying
No multiple selection is turned off
that was my thought too 😞
I think im in one of those its simple but i been at it soo long i can't see it scenario's lol
Gary
That's some good news! After a second look, I did notice a problem in your expression:
If(
DataCardValue8.Selected.DisplayName = DataCardValue7.Selected.DisplayName,true,
IsEmpty(DataCardValue8.Selected.DisplayName = DataCardValue7.Selected.DisplayName),false)
IsEmpty doesn't work with an expression as an argument. It expects a table.
Try this:
If(
DataCardValue8.Selected.DisplayName = DataCardValue7.Selected.DisplayName,true,
Len(DataCardValue8.Selected.DisplayName)<1 && Len(DataCardValue7.Selected.DisplayName)<1,false,
false
)
Nope
my goal is that if the people selection is same show label but it shows when comboboxes are empty too 😞
Gary
Hmm, let's try IsBlank and see if we get somewhere with that one:
If(
DataCardValue8.Selected.DisplayName = DataCardValue7.Selected.DisplayName,true,
IsBlank(DataCardValue8.Selected.DisplayName) && IsBlank(DataCardValue7.Selected.DisplayName), false,
false
)
Out of curiousity, are you getting the correct behavior when the same name is entered for the two candidates?
Yes it works perfectly with duplicate names but the label is visible when both fields have no selections
thats the part im having trouble with
I even tried this lol
If(
Text(DataCardValue8.Selected.DisplayName) = Text(DataCardValue7.Selected.DisplayName)
||!IsBlank(Text(DataCardValue7.Selected.DisplayName)) = !IsBlank(Text(DataCardValue8.Selected.DisplayName))
,true,
false
)
this is going to be such a simple fix but i cant see it 😞
This is strange. Those should be empty strings, but they aren't acting like it. A couple more options:
If(
DataCardValue8.Selected.DisplayName = DataCardValue7.Selected.DisplayName,true,
Len(DataCardValue8.Selected.DisplayName & DataCardValue7.Selected.DisplayName)<1, false,
false
)
If(
DataCardValue8.Selected.DisplayName = DataCardValue7.Selected.DisplayName,true,
And(IsEmpty(DataCardValue8.Selected), IsEmpty(DataCardValue7.Selected)), false,
false
)
User | Count |
---|---|
124 | |
87 | |
86 | |
75 | |
69 |
User | Count |
---|---|
214 | |
181 | |
140 | |
96 | |
83 |