cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JACK_LAI_1117
Helper V
Helper V

How to delete attachment in sharepoint item

 

HI ALL:

    I upload my jpg file with powerapps , and save it in sharepoint list item attachment .

 

JACK_LAI_1117_0-1631498443561.png

   Now I want to delete one of the jpg file in attachments with powerapps , so how could I delete it ???

 

I use this two methods , but not works~~~

1-->Remove('For-pic-upload',(LookUp('For-pic-upload',Title=Dropdown1.Selected.Title).Attachments).DisplayName) in ThisItem.DisplayName

 

2-->RemoveIf('For-pic-upload',DisplayName=ThisItem.DisplayName)

1 ACCEPTED SOLUTION

Accepted Solutions
JACK_LAI_1117
Helper V
Helper V

HI ALL:

  I found the answer !!!

 

NO 1 :

 form mode is "Edit"

JACK_LAI_1117_0-1631522140572.png

 

NO 2 : 

Form "item"

JACK_LAI_1117_1-1631522189066.png

 

NO 3 :

keypoint is submitform() and resetform()

 

JACK_LAI_1117_2-1631522853500.png

 

Finally , I can modify it (add jpg , del jpg )  then click sumbit , so I can get what I want !!!

 

View solution in original post

5 REPLIES 5
rampprakash
Super User
Super User

Hello @JACK_LAI_1117,

 

You can Add Attachment field in Powerapps, there we can easily remove the attachment easily. Let me know if you need any moe help to assist you.

 

Please Mark as Answer if it's helpful

 

Subscribe : https://youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA

Blog : https://microsoftcrmtechie.blogspot.com

 

 

leyburn19
Memorable Member
Memorable Member

If you have a form built on the SharePoint list and navigate to that record,  you will see attachments to delete.  I assume you are looking at a Gallery based on the list as Datasource.  So create a form that is based on the selected item and simply only show attachments.  Then they can be removed

WarrenBelz
Super User
Super User

@JACK_LAI_1117 ,

Just adding to @leyburn19's and @rampprakash's comments - you cannot delete attachments programmatically in Power Apps. This only way would be via Power Automate as below and send the relevant values.

WarrenBelz_0-1631506767450.png

 

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.

 

JACK_LAI_1117
Helper V
Helper V

HI ALL:

  I still want to use form to attachment . This is my step !!!

 

NO 1 : in this sharepoint item has two jpg file 

 

JACK_LAI_1117_0-1631514621825.png

 

NO 2 : I delete dafadsfsa.jpg and add  " new-comer.jpg"

JACK_LAI_1117_1-1631514698563.png

 

NO 3 : I click "Button " , this is my code 

JACK_LAI_1117_2-1631514750606.png

 

NO 4

After I click , I find in my sharepoint item , only have newer jpg file , but the old one jpg file will gone ~~~~~

 

So , I think this is config in forms or powerapps .....Which config sholud I modify ???

JACK_LAI_1117
Helper V
Helper V

HI ALL:

  I found the answer !!!

 

NO 1 :

 form mode is "Edit"

JACK_LAI_1117_0-1631522140572.png

 

NO 2 : 

Form "item"

JACK_LAI_1117_1-1631522189066.png

 

NO 3 :

keypoint is submitform() and resetform()

 

JACK_LAI_1117_2-1631522853500.png

 

Finally , I can modify it (add jpg , del jpg )  then click sumbit , so I can get what I want !!!

 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,363)