cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Burner1
Frequent Visitor

Cannot Clear Attachments in PowerApps

Hi,

 

I have created an app which has the possibility to add an attachment, and therefore is connected to a SharePoint list.

When I'm done creating an item in the SharePoint list with PowerApps and have added an attachment, I want to create a second item. But when I get to the screen where to add an attachment, the attachment from the previous added item is still visible.

This looks like the same problem as multiple users have described here and for those users there isn't a solution yet. Only for the poster of the item.

 

I have tried to use this:

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

All the fields are being resetted, except the attachment field.

 

If I remove the attachment with the "X" when I add the second item, and click on a button which have only ResetForm and NewForm as onSelect, the attachment will return. So, apparently the attachment wasn't really removed by clicking the X, otherwise it would not return right?

 

Any help would be appreciated on this strange matter.

 

 

43 REPLIES 43

Experience same issue for the attachment control in edit form. So strange that don't know how to convince my customer to accept. Yet I cant find workaround after 2 days.

Anonymous
Not applicable

Thank you! Removing Parent.Default on Attachments worked for my form that was showing old attachments.  I also had other fields showing old data.  The problem started for me when I published the form in Edit Mode with existing data.   If you remove the Parent.Default from other fields they will not save back to SharePoint.  To fix the caching issue, I had to change the default mode of the form to "New" and clear all the data out before publishing again.  

WGO
Frequent Visitor

By removing Parent.Default in the items, the attachments don't appear on a form in Edit mode when revising the form.

WGO
Frequent Visitor

I was able to clear the attachment from appearing by changing the Sarepointform1 DATA DefaultMode to FormMode.Edit vs FormMode.New.

 

 

Share-and-Flow
Frequent Visitor

I am facing the same issue for 1 of my SharePoint Custom Forms.

Tried ResetForm(SharePointForm1);

I have read through this entire thread and still have the issue. I will reiterate the issue:
I have a Powerapp displayed on a SharePoint page and fill out the form. All fields show as blank as it's a New form. I submit the form and have another screen with a button to "Submit another form". 

That button has a formula Resetform(form1);newform(form1);navigate(form1screen).

This resets/creates new form except for displaying an attachment in the attachment field. This attachment is the one submitted on the first item in the list, not even the one I just submitted.

I have changed items from Parent.Default to ThisItem.Attachments but that doesn't work either.

Hi There,

 

I have the same issue and have been waiting for some resolution.

Meanwhile, I have restored the very 1st test item I had created in this list and kept it in the list with attachment field blank.
This provided a Band-Aid solution and my new form does not show attachments anymore.

srose
Advocate I
Advocate I

The best way I found to handle the toggle between if a file is attached is to use this: I got this from another person. It allows you to control a variable which you can refer to in other places. So before my user goes to the screen to enter info and attach a file/pic, the variable is set to false, then when they add the file, under Action and OnAddFile it get set to true. This is extremely handy!

srose_0-1600097477199.png

 

Hi @srose

First off, thank you so much as this looks like it has fixed my issue, but I don't quite understand why... I've added Set(isAttached, false) to onNew in SharePointIntegration, and mimicked your picture for the Attachment fields OnAddFile and OnRemoveFile, and it seems to have resolved my issues, but I don't understand how.  Do I need to add these OnAddFile and OnRemoveFile to my attachment fields for my Edit Form and View Form?

 

Thank you for your help ahead of time! 

I am not exactly clear on your question -- maybe this helps: So my app allows only one attachment at a time And I am using a document library vs. a SharePoint list. Also, I need a button to become visible only if user has added an attachment -- so I use the additional true/false variable and OnAddFile, etc. for a few things in my case: the Visible setting for my button is this formula:

CCOwner.Selected.Value <> "-" And Vendor.Text <> "" And Office.Selected.Value <> "-" And Amt.Text <> "" And IsAttached = true And TaxPaid.Selected.Value <> "-" And ProjTask.Text <> ""

 

Thanks!

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,192)