web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Powerapps - Cannot Cle...
Power Apps
Answered

Powerapps - Cannot Clear Attachments

(0) ShareShare
ReportReport
Posted on by

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

Categories:
I have the same question (0)
  • lakishar Profile Picture
    34 on at

    Can you share the code for the Reset button?

  • Community Power Platform Member Profile Picture
    on at

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

     

    Thanks!

     

    David

  • ralphtrickey Profile Picture
    54 on at

    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.

  • lakishar Profile Picture
    34 on at

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

     

     

  • Community Power Platform Member Profile Picture
    on at

    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!

  • ralphtrickey Profile Picture
    54 on at

    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 Profile Picture
    on at

    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 Power Platform Member Profile Picture
    on at

    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

  • ralphtrickey Profile Picture
    54 on at

    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

     

     

     

     

  • Verified answer
    v-xida-msft Profile Picture
    on at

    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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard