cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
virakones
Resolver II
Resolver II

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

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?

1 ACCEPTED SOLUTION

Accepted Solutions
virakones
Resolver II
Resolver II

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':""
                }
           )
)

 

 

View solution in original post

1 REPLY 1
virakones
Resolver II
Resolver II

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':""
                }
           )
)

 

 

View solution in original post

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Users online (2,227)