I need help with a known problem outlined here (https://powerusers.microsoft.com/t5/Building-Power-Apps/Onchange-event-often-triggers-when-screen-be...
I need to compare the value of a field called Targeted (true/false) in a local collection with the toggle control value when it is clicked/changed. I used the following but get an Incompatible types for comparison error (Table/Boolean):
Solved! Go to Solution.
So, you trying to see if the field yes is equal to true... You cant compare that..
You need to "convert" the yes to true and the no to false
So
If(gal_credits.Selected.Target = "yes" && Self.Value = true;
Notify(...)
Hey! That is because you are giving the hole collection.
You need to choose the item of the collectino that you want to compare.
If you want the first:
First(colTargets).Targeted
If you Have them in a gallery:
Gallery.Selected.Targeted
Thanks for the information.
However, I am getting a new comparison issue now, see below:
Any ideas?
Hey.
Is your field Targeted a combobox or a dropdown?
So, you trying to see if the field yes is equal to true... You cant compare that..
You need to "convert" the yes to true and the no to false
So
If(gal_credits.Selected.Target = "yes" && Self.Value = true;
Notify(...)
Thanks that worked! Thanks allot 🙂
Final code was: