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.
Solved! Go to Solution.
Please check and see if the following thread would help in your scenario:
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:
Note: The Editform1 represents the Edit form within your Edit screen.
Can you share the code for the Reset button?
On the Reset button I have ResetForm(Form3). The Form that houses the Attachment Datacard is called Form3.
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)
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.
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:
Set the OnSelect property of the "Reset" button to following formula:
Note: The EditForm1 represents the Edit form control within my app.
On your side, you should type the following formula:
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.
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.
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.
Keep up to date with current events and community announcements in the Power Apps community.
A great place where you can stay up to date with community calls and interact with the speakers.
Check out the latest Community Blog from the community!