web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Reset image inside the...
Power Apps
Unanswered

Reset image inside the gallery to blank, when submit button is clicked

(0) ShareShare
ReportReport
Posted on by 531

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.

 

Iantaylor2050_0-1681836989779.png

 

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.

 

Iantaylor2050_1-1681837231112.png

 

 

 

Categories:
I have the same question (0)
  • JohnM86 Profile Picture
    590 on at

     

    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:

     

    1. 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".

    2. In your Submit button's OnSelect property, add the following code:

     

    UpdateContext({ResetPicture: true});
     
    1. In the Picture control's Image property, wrap the current formula with an If statement that checks the value of the ResetPicture variable. Here's an example:

     

    If(ResetPicture, Blank(), ThisItem.Image)
     

    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.

    1. To reset the ResetPicture variable when you add a new record, add the following code to the OnSelect property of your "Add new record" button:

     

    UpdateContext({ResetPicture: false})
     

    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!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard