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
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.

Users online (1,772)