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
Solved! Go to Solution.
Hi @Anonymous,
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:
ResetForm(EditForm1);NewForm(EditForm1);Navigate(EditScreen1,ScreenTransition.Fade)
Note: The Editform1 represents the Edit form within your Edit screen.
Best regards,
Kris
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.
Thanks!
David
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.
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:
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
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
User | Count |
---|---|
125 | |
87 | |
86 | |
75 | |
69 |
User | Count |
---|---|
215 | |
181 | |
139 | |
97 | |
83 |