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 Button to De...
Power Apps
Unanswered

PowerApps Button to Delete Attachment from Sharepoint using a Flow

(1) ShareShare
ReportReport
Posted on by 63
Hi Team
 
I have a PowerApp made which collects data through forms.  I want the users to be able to upload documents to Sharepoint when completing this form.
I have the upload section working via a button inside the Attachment DataCard, and a PowerAutomate flow.
 
OnSelect for Upload Button:
ForAll(
    attach.Attachments,
   Uploadfiletosharepoint.Run(
        {
            file: {
                name: ThisRecord.Name,
                contentBytes: ThisRecord.Value
            }
        }
    )
)
 
I have also made a flow in PowerApps for the deleting of the sharepoint file, inside a Gallery, inside the Attachment DataCard.  However, i am having trouple with getting the OnSelect for Delete Button, working correctly.
 
 
This is the Delete Attachment PowerAutomate within PowerApps:
Not sure if i'm missing anything here.
I have the same question (0)
  • WarrenBelz Profile Picture
    153,079 Most Valuable Professional on at
    Hi KristyH 
    I think you need this action
     
     
    Please click Does this answer your question 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 a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee

     
  • WarrenBelz Profile Picture
    153,079 Most Valuable Professional on at
    Just following up to see if you received the answer you needed, or if you require further assistance.

    Please click Does this answer your question 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 a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee
  • KristyH Profile Picture
    63 on at
    Hi, no, it doesn't answer my question at all.
    I asked specifically about the OnSelect for the delete button to make the flow work.
    so if i did change the flow to Delete Attachment instead, i am still unsure about the coding on the OnSelect button.
  • WarrenBelz Profile Picture
    153,079 Most Valuable Professional on at
    Hi KristyH 
    Just be aware I am not aware of your coding level/skills, so many times pointing people in the right direction works without further comment works and if not, I assume they will come back for further clarification.
    This one however is far from straight forward when I did some testing. You need to send at least two parameters to the Flow - the ID of the record and the name of the attachment. I have hard-coded the site and list names, but you could also send them if you want to make this Flow generic.
    The Flow looks like this - I have tested it and can confirm it works - you may need a refresh of the data source afterwards to display the changes.
     
    Just following up to see if you received the answer you needed, or if you require further assistance.

    Please click Does this answer your question 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 a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee

     
  • Michael E. Gernaey Profile Picture
    53,429 Super User 2025 Season 2 on at
    HI
     
    I am super confused, based on your response to Warren. You are in fact deleting the item (or you want too), in the flow, so why would what Warren said, somehow not answer your questions.
     
    You are NOT deleting it in the App... but you also have to be careful with wording. You said you want to upload files, thats not exactly true. You ant to attach files, uploading them means putting them in a Document library.
     
    So you cannot simply delete it like its in a library, if you actually made it an Attachment when you created it. Since you are using the Attachment control, we have to assume you are.
     
    To then delete the Attached(not uploaded file), you have to do what Warren said.
     
    You should really be more respectful when you don't know what you are saying. Warren answered exactly how its done so it 'DOES answer your question.

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