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 / Email attachment from ...
Power Apps
Answered

Email attachment from other SharePoint list

(0) ShareShare
ReportReport
Posted on by 15

I have two collections in my PowerApps.  empCol with employee details like Name, Emp_code, DOJ etc and resumeCol with Emp_code and resume as attachment. I want to send an email with  contents of empCol along with the corresponding resumes from resumeCol when the Emp_code matches. I was able to send email with the empCol data

 

Office365Outlook.SendEmailV2(_emailRecipientString, TextEmailSubject1.Text, RichTextEditor8.HtmlText & RichTextEditor1.HtmlText, {Importance:"Normal"});

 

I don't know how to pick the attachments from resumeCol where Emp_code matches and attach those resumes. Any help would be greatly appreciated.

Thanks

Rajesh

 

 

Categories:
I have the same question (0)
  • Soham_Patil Profile Picture
    9 on at

    Hello Rajesh, 
    You will need to fetch the record using LookUp for the attachments in the second list using the EmpCode condition as mentioned below.

    Office365Outlook.SendEmailV2(
    _emailRecipientString,TextEmailSubject1.Text,RichTextEditor8.HtmlText & RichTextEditor1.HtmlText, 

    {

         Attachments: ForAll( LookUp(resumeCol, EmpCode = <empCol item>.EmpCode).Attachments, { ContentBytes: Value, Name: Name } )

    }

    );

    Reference : https://www.matthewdevaney.com/power-apps-send-email-using-outlook-the-complete-guide/

  • rajeshcs377 Profile Picture
    15 on at

    Hi Soham

    Thanks a lot for your response. Somehow I am not able to get it working.

    I am getting multiple errors out of which the first one is "You do not have permission on this blob". Also I am not able to figure out the Name value. 

  • rajeshcs377 Profile Picture
    15 on at

    The below formula worked but it is fetching only one resume.

    Office365Outlook.SendEmailV2(_emailRecipientString,TextEmailSubject1.Text,RichTextEditor8.HtmlText & RichTextEditor1.HtmlText, 

    {

         Attachments: ForAll( LookUp(resumeCol, EmpCode exactin empCol.EmpCode).Attachments, { ContentBytes: Value, Name: DisplayName } )

    }

    )

  • rajeshcs377 Profile Picture
    15 on at

    Is there a way I can email the attachments from a collection? There will be one attachment per record.

  • Verified answer
    rajeshcs377 Profile Picture
    15 on at

    Dear All

    Finally I got it working!

    My requirement - I have two lists one with employee details and other with resumes of the employees. I wanted to send few records from the employee details list as an email and while sending those records, I wanted to attach the resumes of those selected employees picking the correct resumes from the employees list. 

     

    Here is the solution

     

    I have created two collections one with employee details to be send out and the other with the corresponding resumes of the selected employees. Then I have created another collection with only the resumes with the following command

     

    ClearCollect(count,0);ClearCollect(resumeAttachments,Filter(Ungroup(ForAll(Sequence(CountRows(resumeCol)),Collect(count,Last(count).Value+1);{AAA:Last(FirstN(resumeCol,Last(count).Value)).Attachments,BBB:Last(FirstN(resumeCol,Value)).ID}),"AAA"),!IsBlank(Id)));

     

    Following this post Solved: Re: Save Sharepoint List Attachments in a collecti... - Power Platform Community (microsoft.com)

     

    And for sending email with attachments used the below formula

     

    Set(_emailRecipientString, Concat(MyPeople, Mail & ";"));          

    Office365Outlook.SendEmailV2(_emailRecipientString, TextEmailSubject1.Text, emailBody.HtmlText,

     

    {Attachments:ForAll(resumeAttachments,{ContentBytes:Value,Name:DisplayName})});

     

    Thanks

     

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 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard