Skip to main content

Notifications

Power Apps - Building 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

  • Re: Removing SharePoint List Attachment using a Button

    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

  • Re: Removing SharePoint List Attachment using a Button

    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

  • Nemesis_TR Profile Picture
    Nemesis_TR 10 on at
    Re: Removing SharePoint List Attachment using a Button

    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

     

  • Re: Removing SharePoint List Attachment using a Button

    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

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,666

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,996

Leaderboard