web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Collect "ContentBytes"...
Power Apps
Answered

Collect "ContentBytes" & "Name" from Filter function to attach file from CDS File Field in a SendEmail

(0) ShareShare
ReportReport
Posted on by 406

Hi,

 

I have 2 entities: Groups > 1:N > Requests. You have Groups that can have many Requests.

These Requests entity has a File field in the Common Data Service entity where users attach a file through a standard Form control.

The user can have many Requests per Group and thus may have many Request File Attachments to send from the previously selected Group. I want to be able to send those files as an attachment in a separate "send email" control.

When I use a Filter: 

Filter('Requests Entity', 'Group Requests Relationship'.ID = galleryGroups.Selected.ID)

This filters the Request columns for the selected gallery item from Groups. If I try to collect that:

Collect(collectionRequestFilesFilter('Requests', 'Group Requests Relationship'.ID = galleryGroups.Selected.ID).'Request File Attachment'))

The collection is a table returned of the collected Request File Attachments - however, I'm not able to access the columns I need except if I click into it under settings I see: "FileName" & "Value".

Question: How do I achieve separating out the specific columns where "FileName" = Name, "Value" = ContentBytes, "@odata.type" = "", so that I can send these files as attachments in a sendemail function?

I have the same question (0)
  • Verified answer
    virakones Profile Picture
    406 on at

    Just replying to myself to mark this as solved:

    This is my adjusted formula:

     

     

    ClearCollect(collectAttachments,
     ForAll(Filter
     ('Requests Entity','Group Requests Relationship'.ID=galleryGroups.Selected.ID).'Request File Attachments',
     {
     Name:'Request File Attachments'.FileName,
     ContentBytes:'Request File Attachments'.Value,
     '@odata.type':""
     }
     )
    )

     

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 955

#2
11manish Profile Picture

11manish 652

#3
Valantis Profile Picture

Valantis 626

Last 30 days Overall leaderboard