I have a collection that is completed when you add an attachment to an attachment control in the case of adding a file. I put the following formula
Collect(
Excels,
{
First Name: Last(attExcel.Attachments) .Name,
DataStream: Last(attExcel.Attachments) .Value
}
)
Now, in case the attachment in the control is deleted, I also want to remove it from the collection
Do you have any idea how to achieve this?
Solved! Go to Solution.
Hi @King ,
You just need to ClearCollect the remaining attachments
ClearCollect(
Excels,
{
First Name: attExcel.Attachments.Name,
DataStream: attExcel.Attachments.Value
}
)
I do this on every attach and delete - simply creates a new collection with the current attachments.
If you don't need to rename the fields
ClearCollect(
Excels,
attExcel.Attachments
)
This will have two fields - Name and Value. The Value will show as an image in an image control if required.
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.
Hi King,
Just collect again on the OnRemoveFile property of the attachment control.
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.
nevermind he's got ya
Hi @WarrenBelzthanks for answering
I did what he told me and what he does is create a new blank record in the collection without deleting the previous one.
Hi @King ,
You just need to ClearCollect the remaining attachments
ClearCollect(
Excels,
{
First Name: attExcel.Attachments.Name,
DataStream: attExcel.Attachments.Value
}
)
I do this on every attach and delete - simply creates a new collection with the current attachments.
If you don't need to rename the fields
ClearCollect(
Excels,
attExcel.Attachments
)
This will have two fields - Name and Value. The Value will show as an image in an image control if required.
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.
Hi @WarrenBelz
Thank you for your help, what helped me in my case was the second formula indicated by you.
ClearCollect (
Excels,
attExcel.Attachments
)
which forced me to rename my collection columns called
FirstName and DataStream to
Name and value
Stay up tp date on the latest blogs and activities in the community News & Announcements.
Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
User | Count |
---|---|
206 | |
185 | |
71 | |
37 | |
34 |
User | Count |
---|---|
347 | |
276 | |
121 | |
78 | |
59 |