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 / Attachment control not...
Power Apps
Unanswered

Attachment control not working properly while deleting - EditForm

(0) ShareShare
ReportReport
Posted on by 531

I have an attachment control in Powerapps EditForm. If i delete the documents which i uploaded, its deleting wrong documents.

 

May i know what is incorrect here?

 

In the screenshots below, I tried deleting 2nd document (i.e. Supp_Doc4pdf.pdf), however it deletes the first one. 

 

Iantaylor2050_0-1700707957943.png

 

Iantaylor2050_1-1700707987940.png

 

Attachments Items Property

Filter(
 Documents,
 Unique_Submission_ID = ThisItem.Unique_Submission_Id&& 'Folder path' = "Shared Documents/Quotation/" &DataCardValue3_2.Text&"/" 
)

 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,073 Most Valuable Professional on at

    @Iantaylor2050 ,

    The issue I believe is your Items (normally it is simply ThisItem.Attachments). Although the attachment control will respond to other code, inbuilt functions such as you are attempting may be completely throw it off - it has no idea what to delete are you are no longer referring to the files it is expecting to see there.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • Iantaylor2050 Profile Picture
    531 on at

    Hi @WarrenBelz 

     

    I am not using SharePoint list attachment column here. Hence i couldn't use ThisItem. Attachments.

     

    All my documents come from document library. Is there any alternative way to handle this?

  • WarrenBelz Profile Picture
    153,073 Most Valuable Professional on at

    Hi @Iantaylor2050 ,

    The attachment control will have absolutely no idea of that to delete as I mentioned. A lot of workarounds are possible with it, but I think your requirements are "a bridge too far". I think you need to use a Gallery and refer to the ID of the item and delete it with a Flow.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • Iantaylor2050 Profile Picture
    531 on at

    Hi @WarrenBelz 

     

    Yes i am planning to use gallery in EditForm. Deletion of documents will be much easier if i use gallery.

     

    However is there any way where i can add documents to Gallery which should get stored in document library?

     

    Any article on the same would be much helpful. 

  • WarrenBelz Profile Picture
    153,073 Most Valuable Professional on at

    Hi @Iantaylor2050 ,

    I know we are dealing with two related threads here, but there is nothing wrong with using an attachment control to store files in a Library (I do it this way on many apps). I just do not use that control for anything else other than this purpose.

  • Iantaylor2050 Profile Picture
    531 on at

    Hi @WarrenBelz 

     

    I am using attachment control to add additional documents in Edit Form. However i am receiving error for the same. 

     

    Is it because of my Items property of the attachment control?

  • WarrenBelz Profile Picture
    153,073 Most Valuable Professional on at

    Hi @Iantaylor2050 ,

    I would have a good guess and say yes to that. If you are going to repurpose an attachment control, you really can only use it for that purpose.

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 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard