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 / Removing SharePoint Li...
Power Apps
Unanswered

Removing SharePoint List Attachment using a Button

(0) ShareShare
ReportReport
Posted on by 10

Greetings,

I am in the process of developing an application.

The workflow is as follows:

  1. A user, acting as a requester, submits an inquiry.

  2. Subsequently, another user (referred to as the solution provider) generates an Excel file containing a solution. This file is then attached to a SharePoint list through the application.

  3. Upon testing and confirmation of the successful implementation of the solution, the requester approves the proposed solution.

  4. In cases where the solution proves to be ineffective, the requester user has the option to reject it. Consequently, the attached Excel file associated with the solution will be removed from the list.

I am encountering a challenge in implementing a button control that facilitates the deletion of attachments. Despite my efforts, I have been unable to successfully accomplish this task. Is there anyone available who could offer assistance in resolving this matter?

Thank you.

 

"DataCardValue19_1" holds the attachment in the "Form4_2"

 

2.JPG

Categories:
I have the same question (0)
  • v-mengmli-msft Profile Picture
    on at

    Hi @Nemesis_TR ,

     

    Currently, it is not supported to delete the content in the attachment in the SP list through the button, only click "X". If you insist on doing so, you can change your data source to Dataverse Table and use the column of file to save your files.

     

    Then you can try this:

    Set the OnSelect of the Button:

     

    Patch(TableName,
    //your tableName
    LookUp(TableName,Column1=Column1_DataCard1.Update),
    //find the record according to condition
    {AttachmentName:{FileName:"",Value:""}})
    //Clear your attachment column

     

    vmengmlimsft_0-1693278542847.png

     

    Best regards,

    Rimmon Li

  • Nemesis_TR Profile Picture
    10 on at

    Thank you for the reply.

     

    Appologies for my silly question. Please find my table below. in this how lookup must be formulated?

     

    Nemesis_TR_0-1693303668343.png

    Is below correct? It didn't work like below 😞

    Patch(APErrorHandlingList,
    //your tableName
    LookUp(APErrorHandlingList,Atatchments=DataCardValue19_1.Update),
    //find the record according to condition
    {AttachmentName:{FileName:"",Value:""}})
    //Clear your attachment column

     

    Nemesis_TR_1-1693303850359.png

     

  • v-mengmli-msft Profile Picture
    on at

    Hi @Nemesis_TR ,

     

    The above code does not support apps that use SP as a data source. This is because it is not supported to delete the files in the attachment control in the SP list through the button, only click "X".

     

    If you want to use the above code, you need to change your data source to the Dataverse Table.

     

    If my previous answer is helpful, I hope you can accept it as a solution to help more people.

     

    Best regards,

    Rimmon Li

  • v-mengmli-msft Profile Picture
    on at

    Hi @Nemesis_TR ,

     

    How is the situation? Have you solved your problem? If you find my answer helpful, you can accept it as a solution to help more people trapped in this problem.

     

    Best regards,

    Rimmon Li

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…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Kalathiya Profile Picture

Kalathiya 372 Super User 2026 Season 1

#2
WarrenBelz Profile Picture

WarrenBelz 303 Most Valuable Professional

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 238 Super User 2026 Season 1

Last 30 days Overall leaderboard