cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Powerapps - Cannot Clear Attachments

I am having an issue on Powerapps where I can attach a file and complete a form using the SubmitForm.  I have tried multiple ways to reset the Attachment control including NewForm, ResetForm, Reset and nothing has worked.  I made a simple form and added a Reset button.  If I manually click the "X" the file disappears, but I do not want user intervention.  If I click ResetForm, a "ghost" item of the file pops back up.

 

Thanks,

 

David

17 REPLIES 17

Hi @Anonymous,

 

Please check and see if the following thread would help in your scenario:

https://powerusers.microsoft.com/t5/General-Discussion/How-can-we-reset-the-attachment-field/td-p/136245

 

When you navigate from other screen to the Edit screen (contains the Edit form), please take a try to set the OnSelect property of the "Navigate" button to following formula:

ResetForm(EditForm1);NewForm(EditForm1);Navigate(EditScreen1,ScreenTransition.Fade)

Note: The Editform1 represents the Edit form within your Edit screen.

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Kris,

 

Thanks!  That worked.

 

- David

Kris,

I'm having the same issue that David had, but your solution isn't working for me.  I'm trying to do almost the exact same thing.  I have a form with an attachment control included.  When I run the app, enter data, add an attachment, and click the Reset button, the attachment actually changes to an older attachment from a previous attempt. What the what?!  If I click on the X icon for the attachment, it clears fine, but not when I use the button.  The function I'm trying to accomplish is for the user to clear out any information they've put in the form so they can start fresh.

 

Here's what I have on my OnSelect property (Form1 is the form with the attachment control):

 

ResetForm(Form1);NewForm(Form1);Navigate(Form1,ScreenTransition.None)

Anonymous
Not applicable

Was a solution found for this?

 

I have a similar situation where a user can submit a form with an attachment, then after submission they can choose to submit another. I have used both resetform and new form and both will reset all other fields but any attachments do not reset.

Don't think so. And since this issue is marked as 'Solved' I have created a new topic:

https://powerusers.microsoft.com/t5/General-Discussion/Cannot-Clear-Attachments-in-PowerApps/m-p/185...

Anonymous
Not applicable

I used an attachment control outside of a form (copied it out of a temporary form) and I was able to clear it after submission by using Reset(Name of Attachment Control)

 

reset-attachment.PNG

This worked for me as well.  My attachment controls are outside the SharePoint form because of certain requirements

NazCastro
Frequent Visitor

If someone is still having this issue - Try this on the OnNew property of SharePoint Integration.

 

ViewForm(YourForm);ResetForm(YourForm);NewForm(YourForm)

 

How did I come up with this? I noticed that if you view the item first in the list - it somehow resets the attachment control to empty, hence the viewform in the code. This works for me.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,475)