I have a Gallery which has a Picture control from powerapps. Need to reset the picture to blank once submit button is clicked or when new record is added in gallery when clicked on + icon.
Tried to add the code Reset(AddMediaButton2)=true in Submit button, but it throws the below error.
Any inputs on how to make the image blank when submit button is clicked or when + icon from top is clicked in the below screenshot. Currently even the + icon shows up the same image from the 1st row. It should show blank image when new record is added.
It seems like you're trying to reset the AddMediaButton2 control using the Reset function, but that's not the correct way to reset a picture control. Instead, you can use the UpdateContext function to set the value of the picture control to blank. Here's how you can do it:
Add a context variable to your app by clicking on the "View" tab in the left-hand pane and selecting "Variables" from the dropdown menu. Then click on "New variable" and give it a name like "ResetPicture".
In your Submit button's OnSelect property, add the following code:
This formula checks whether the ResetPicture variable is true. If it is, the formula returns Blank() which sets the picture control to a blank image. Otherwise, it returns the current image for the item.
This code sets the ResetPicture variable to false so that the picture control is not blank when you add a new record.
I hope this helps!
WarrenBelz
146,660
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,004
Most Valuable Professional