title: How to properly use an If statement in PowerApps when trying to toggle visibility of an element?
body: <p>I would like to toggle the visible property of a button that is nested in a Gallery in my PowerApp. </p>
  
  <p>What I tried to was to go off of whether the parent was selected. I placed this formula inside the Visible property.</p>
  
  <p>ink its a type issue, but I am not sure what is the best way to fix this.</p>
  
  <pre><code>If(Parent.Selected = true, true, false)
  </code></pre>
  
  <p>I received an "Invalid argument type" error on the "=" operator, so I think that perhaps I have a type mismatch or some other issue.</p>