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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Apps
Answered

Reset Form on save

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

I have a save button to submit my form which includes an image taken by the camera. My issue is that when you return to the form the old image is still there and I need it to reset. I have tried:   SubmitForm(FormNewExpense) & ResetForm(FormNewExpense)

But this is not working.

 

Any suggestions?

Categories:
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    After a lot of internet trawling, it appears there is no way to clear the cached image - which seems rather ridiuclous to me. Perhaps this will be available in the future?

     

    As a work around I wonder if it is possible to change the visibility of the image box until the user has clicked the camera image? This would hopefully then hide the image box that stills holds the last image until it has been refreshed. Does anyone know if this is possible or, even better, how I might achieve it?

  • v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    Could you tell me 

    1)what do you want to do by using this form, edit an existing record or create a new record?

    2)what control do you use to update the captured image? what formula do you use to display the image?

     

    I assume that you use an imge control to display the captured image.

    If so, the image that the control displays is determined by its Image property.

    If you want the image control diaplying nothing, you need to clear its Image property.

    So I suggest you set the submit button's OnSuccess: 

    Set(var,true)

    Then set the imge control's Image:

    If(var,"",Camera1.Photo)

     

     

    Best regards,

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @v-yutliu-msft 

     

    I've attached a screenshot of the form. It creates a new record.

    I'm using the camera (Camera1) within a datacard to take a picture which is then stored in the right hand box as Camera1.Photo - This is the image box that does not clear the cached image the next time you visit the screen.

     

    As regards your suggestion of adding code to the OnSuccess of the Submit Button - I can't see where to put this. OnSUccess does not appear on any of the buttons options.

    Screenshot 2019-10-28 at 08.11.02.png
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I thought I had found a workaround by making the ImageData box invisible until Camera1 had been clicked - this does work and achieves the desired effect as it effectively hides the cached image until a new one has been created.

    However, when you then try to return to the screen everything but the form appears along with a message 'Getting your data' which never changes until you press the back button, when the whole screen flashes up before returning to the 'Home' screen.

    Any ideas why this is happening?

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Update. After searching the forums for anything useful I stumbled on to a post from @JRaasumaa  in 2017 that looked promising - and turned out to be the perfect answer - achieving the 'hide the cached image box' until the user clicked the camera but without the wired 'getting your data' screen I kept getting with my dodgy coding 🙂

     

    I don't know how to link to other posts so I've copied and pasted it below. So thank you @JRaasumaa 

     

    To have the box start off invisible and show up on button press:

     

    1. Create the Text box as a label.

    2. Insert the name in the text box

    3. Selected the text box and set upper left to "Visible" and the function is as follows: 

    If(VisibleVar=true,true,false)

    4. Select the screen and then change the upper left to "OnVisibile" and the function is as follows:

    UpdateContext({VisibleVar:false})

    5. Select the Button and change the upper left to OnSelect: 

    UpdateContext({VisibleVar:true})

    6. Navigate away from the screen and back. Upon being visible it will set the VisibleVar to false, leaving your text box hidden. Pressing the button will then change VisibleVar to true showing the text box. 

     

    To make the box visible on screen load and then disappear on click simply reverse the #3 step true/false

    If(VisibleVar=true,false,true)

    (or reverse on-load to false and onselect to true, your choice)

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 360 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 325

#3
Mohsin Ali Profile Picture

Mohsin Ali 232

Last 30 days Overall leaderboard