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

1 ACCEPTED SOLUTION

Accepted Solutions

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.

View solution in original post

17 REPLIES 17
lakishar
Frequent Visitor

Can you share the code for the Reset button?

Anonymous
Not applicable

On the Reset button I have ResetForm(Form3).  The Form that houses the Attachment Datacard is called Form3.

 

Thanks!

 

David

ralphtrickey
Helper I
Helper I

I'm having what sounds like a related issue. I have an attachment control on a form and I'm sometimes carrying over attachments from the previous submission. It's acting like the attachments control isn't clearing the way it should.

I have a similar use case and the way I got it to remove the previous attachment is by using SubmitForm(Form1); NewForm(Form1)

 

 

Anonymous
Not applicable

Thank you for the reply.  Unfortunately, I do not want to submit the form.  This is more when the user saves the data they have entered into a temporary table, and then they want to start another form.  I did try adding NewForm(Form3) to it, but that did not solve it.  Thanks!

Sorry, you misunderstood what I said, I think that your problem and my problem are possibly related. When I start a brand new form, it should be empty. Sometimes, if I've created another form and made attachments, the brand new form already has attachments already set. That's not supposed to happen.

v-xida-msft
Community Support
Community Support

Hi @Anonymous,

 

Do you want to reset the Attachments control within the Edit form of your app?

 

I have made a test on my side (using ResetForm function), and don't have the issue that you mentioned. The GIF screenshot as below:Test1.gif

 

 

Set the OnSelect property of the "Reset" button to following formula:

ResetForm(EditForm1);NewForm(EditForm1)

Note: The EditForm1 represents the Edit form control within my app.

 

On your side, you should type the following formula:

ResetForm(Form3);NewForm(Form3)

 

If the issue still exists, please take a try to re-create your app (generate an app from SP list data source), then check if the issue is solved.

 

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,

 

Thank you for the great detail!  If I add an attachment and then apply the ResetForm without leaving the page, the attachment will be removed.  My porblem is if I attach an item and then leave the page and then come back, the item still shows up and I cannot Reset it.  Even more confusing, is if I use the "X" on the Attachments, the file goes away.  If I then click the ResetForm, the attachment from earlier comes back.  I have tried the ResetForm(Form3); NewForm(Fom3), but unfortunately, it did not work.  My attached pic above called "PA_AttachmentIssue_03.JPG" shows what it looks like when I enter the form.  Please note that I do use on RemoveForm on the OnVisible command.

 

It appears that Ralph (who posted above as well) is experiencing the same issue.

 

Thanks!

 

David

David,

  I think that we may have a related cause, it sounds like the attachments control isn't always clearing the way it should.

 

To reproduce my issue.

Create a SharePoint list. In my case, it has several dropdown lists and other entry fields.

Make sure the attachments are visible in the list settings.

Create a PowerApps SharePoint form from that list with an attachments control. My form is also hiding/showing two fields using a function in their visible property based on the user. That is the only custom code on this form.

Using that SharePoint PowerApps form, add items with attachments. Occasionally the attachments control won't clear when adding a new item and leave old attachments listed.

 

Ralph

 

 

 

 

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,449)