cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
LukasSliuzas
Helper II
Helper II

Removing Attachments using Attachment control

Hello,

 

I have a gallery with attachment control. When having Gallery selected item I wish to remove one out of maybe 3 attachments. Looking for guidance how to do such thing. 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @LukasSliuzas ,

 

Not sure if you meant Attachment ID or something else.

 

Below code will help you get the attachments in the SharePoint list items.

 

Filter(DataSourceName,Condition).Attachments.id
or 
Filter(DataSourceName,Condition).Attachments.DisplayName

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

View solution in original post

11 REPLIES 11
PG_WorXz10
Resident Rockstar
Resident Rockstar

Hi @LukasSliuzas ,

 

Do you randonly want to remove the item from the attachment control or you have any 'X' icon to remove the selected attachment from the attachment control ? 

A screenshot will be helpful. 

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

Hi @PG_WorXz10 

 

Yes I do "X" but I don't use EditForms to create this attachment controls. All of my fields and items are created/updated via Patch. No SubmitForm(Form1) thing

LukasSliuzas_0-1629270258748.png

 

vidyadhar
Frequent Visitor

For attachment control  use this action ,OnRemoveFile on this action use flow to remove the desired file from the sharpoint.

@vidyadhar Hello,

 

Do you have an example how to do such flow?

Hi @LukasSliuzas ,

 

In the Create screen do you have this control ? 

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

@PG_WorXz10 

 

Yes I do and I use OnAddFile:

LukasSliuzas_0-1629272129830.png

 

Then I just push that data via PowerFlow and issue solved. If I could somehow get those attachments into Collection again and maybe somehow to compare them I could run same flow but backwards

 

Hi @LukasSliuzas ,

As per your code it seems you are collecting all the attachments in colFinalData. Are you pushing all the attachments at once or one by one ? 

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

Yes I do push all of them at the same time in a flow.

@LukasSliuzas 

In that case it is possible for you to create a gallery and add colFinalData as item and show the attachment name in text field and add a cross icon on click of which you can delete the files and after that on button trigger or some other trigger you can push the remaining attachments into the flow. 

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,980)