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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Passing collection in ...
Power Apps
Unanswered

Passing collection in Office365.SendMail Attachment Fail

(0) ShareShare
ReportReport
Posted on by

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

I have the same question (0)
  • Verified answer
    v-xida-msft Profile Picture
    on at

    Hi @Anonymous ,

    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,

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard