Hi stupid question i know but i never understand why i need to use the operator || to evaluate my condition.
I have a buton and i want to display it, if the value from the component 1 and for the component 2 are true.
This is my formula - it's working
If(IsEmpty(Attachfiles.Attachments) || IsBlank(dpd_typologiedocs.Selected.Value);DisplayMode.Disabled)
So if there are no files in the component attachfiles and if the selected value is blank in the dropdown component, disable the displaymode.
At first, my logical says me to use And (&&) operator and how it didn't work i use || and it works.
I know it' s a stupid question. shame on me
Thank for your clarification
Solved! Go to Solution.
Hi @Anonymous
Not at all.. there's no such thing as a stupid question... or / and can be a bit of a minefield in certain situations.
Your instinct is correct and you need to use the And operator (i.e. to achieve 'true' And 'true'). If it didn't work when you used And, but it did work when you used Or, this means one of the two functions has not equated to true and needs to be corrected - but it appeared to work, as with Or all you need is one instance of 'true' (i.e. component 1 = true Or component 2 = true.
You can highlight each component in the formula bar to see which one it is that is showing false, when you expect true - and needs fixing.
Hope this helps
Hi @Anonymous
Not at all.. there's no such thing as a stupid question... or / and can be a bit of a minefield in certain situations.
Your instinct is correct and you need to use the And operator (i.e. to achieve 'true' And 'true'). If it didn't work when you used And, but it did work when you used Or, this means one of the two functions has not equated to true and needs to be corrected - but it appeared to work, as with Or all you need is one instance of 'true' (i.e. component 1 = true Or component 2 = true.
You can highlight each component in the formula bar to see which one it is that is showing false, when you expect true - and needs fixing.
Hope this helps
Oh my god. I forgot that the if function evaluate if the conditions are true...
And in my case, if i add a file in the component attachfiles, the instance change to false.
It seems logical now.
Thanks you for your explanation
That great @Anonymous - glad you got sorted.
User | Count |
---|---|
259 | |
110 | |
97 | |
52 | |
39 |