Hi
I have an image field in a gallery that I want to toggle between a "question-mark", "Approved" or "Unapproved" image when the user clicks on the image. When the user clicks the image the field ThisItem.Approved (which is a column in the database) should toggle between Blank(), 1 and 0 but for some reason I cant get this to work. I followed this https://powerusers.microsoft.com/t5/Building-Power-Apps/Within-a-Gallery-Set-the-value-of-a-Textbox-Checkbox-quot/m-p/283593#M82156 thread but my desired functionality is just a bit different and it just doesnt work for me.
I have an image set up with three different images. I can toggle between them if I put the following in the OnChange for the image (so I know toggling the image works):
UpdateContext( {cvApproved:cvApproved+1} );
and in the Image property:
If( cvApproved = 1, MyApproved , If( cvApproved = 2, MyNotApproved, MyQuestionMark ))
but obviously this isnt a working solution (it doesnt toggle around and also all of the rows toggle together).
If I change the Image property to:
If( ThisItem.Approved = 1, MyApproved , If( ThisItem.Approved = 2, MyNotApproved, MyQuestionMark ))
and the OnSelect code to:
If( ThisItem.Approved = 0, ThisItem.Approved = 1, If( ThisItem.Approved = 1, ThisItem.Approved = Blank(), ThisItem.Approved = 0 ))
it doesnt work.
How can I make this work???
Thanx!