cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper III
Helper III

Passing collection in Office365.SendMail Attachment Fail

Hi PowerUsers,

 
I am having this issue while passing collection as an attachment.


I am trying to send multiple attchments (Through CDS attachements) in Email thourgh Office 365 SendMail function.
When attaching collection in Attachment section of  send email function i am receving an Error. (Find Attched Image)

Blob_error.png

I am also attaching the screenshot of expression I wrote for making a collection (Please see attached image).

Screenshot_1.png
I have followed this tutorial for sending multiple attachments, still no Luck.
https://www.youtube.com/watch?v=V3feURQfY3M

I am hoping for a swift response. 

Regards,
Ali Nawaz

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Passing collection in Office365.SendMail Attachment Fail

Hi @Ali_Nawaz ,

Based on the formula you used to create the Collection, I think there is something wrong with it.

 

The result the DataCardValue4_1.Name formula and DataCardValue4_1.Value formula returns is a Table value rather than a single text value. But within the Attachments property of the Office365.SendEmail() function, the Name property is required to provide a text value.

 

I have made a test on my side, please take a try with the following workaround:9.JPG

 

10.JPG

Set the OnSelect property of the "Collect" button to following:

ClearCollect(
             AttachCollect,
             ForAll(
                    RenameColumns(DataCardValue9.Attachments,"Name","Name1", "Value", "Value1"),
                    {
                       Name: Name1,
                       ContentBytes: Value1,
                       '@odata.type': ""
                   }
               )
)

On your side, you should collect your Attachments files into a Collection using the following formula:

ClearCollect(                /* <-- Modify your formula here */
             AttachCollect,
             ForAll(
                    RenameColumns(DataCardValue4_1.Attachments, "Name", "Name1", "Value", "Value1"),
                    {
                       Name: Name1,
                       ContentBytes: Value1,
                       '@odata.type': ""
                   }
               )
)

then set the OnSelect property of the "Send Email" button to following:

Office365.SendEmailV2(
"Test1@xxxxxx.onmicrosoft.com",
"PowerApps Test",
"PowerApps Test Email",
{Attachments: AttachCollect}
)

On your side, you should modify your Office 365 SendMail as below:

Office365.SendEmailV2(
                       "Your EMail Address", 
                       "Subject", 
                       "EMail Body",
                       {
Attachments: AttachCollect,
IsHtml: true,
Importance: "Normal"
} )

The attachment files would be sent well as below:11.JPG

Please take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Highlighted
Community Support
Community Support

Re: Passing collection in Office365.SendMail Attachment Fail

Hi @Ali_Nawaz ,

Based on the formula you used to create the Collection, I think there is something wrong with it.

 

The result the DataCardValue4_1.Name formula and DataCardValue4_1.Value formula returns is a Table value rather than a single text value. But within the Attachments property of the Office365.SendEmail() function, the Name property is required to provide a text value.

 

I have made a test on my side, please take a try with the following workaround:9.JPG

 

10.JPG

Set the OnSelect property of the "Collect" button to following:

ClearCollect(
             AttachCollect,
             ForAll(
                    RenameColumns(DataCardValue9.Attachments,"Name","Name1", "Value", "Value1"),
                    {
                       Name: Name1,
                       ContentBytes: Value1,
                       '@odata.type': ""
                   }
               )
)

On your side, you should collect your Attachments files into a Collection using the following formula:

ClearCollect(                /* <-- Modify your formula here */
             AttachCollect,
             ForAll(
                    RenameColumns(DataCardValue4_1.Attachments, "Name", "Name1", "Value", "Value1"),
                    {
                       Name: Name1,
                       ContentBytes: Value1,
                       '@odata.type': ""
                   }
               )
)

then set the OnSelect property of the "Send Email" button to following:

Office365.SendEmailV2(
"Test1@xxxxxx.onmicrosoft.com",
"PowerApps Test",
"PowerApps Test Email",
{Attachments: AttachCollect}
)

On your side, you should modify your Office 365 SendMail as below:

Office365.SendEmailV2(
                       "Your EMail Address", 
                       "Subject", 
                       "EMail Body",
                       {
Attachments: AttachCollect,
IsHtml: true,
Importance: "Normal"
} )

The attachment files would be sent well as below:11.JPG

Please take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Users online (6,504)