Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Sending an email through PowerApps with attachments from a sharepoint list

(0) ShareShare
ReportReport
Posted on by 15

Hi,

 

I'm having trouble trying to send an outlook email with attachments from a sharepoint list. I have a button that when clicked sends out a message using Office365Outlook.SendEmailV2. I'm trying to use collections to gather the images:

ClearCollect(
PicCol,
LookUp(AreaPicturesV2, Area = AreaCombo.Selected.Area, Picture1),
LookUp(AreaPicturesV2, Area = AreaCombo.Selected.Area, Picture2),
LookUp(AreaPicturesV2, Area = AreaCombo.Selected.Area, Picture3),
LookUp(AreaPicturesV2, Area = AreaCombo.Selected.Area, Picture4),
LookUp(AreaPicturesV2, Area = AreaCombo.Selected.Area, Picture5)
);

The LookUp here goes into the sharepoint list, depending on the area selected, it'll put in the pictures of that selected area.

 

The images are saved as the image item in the list as a column, with me trying to get that image from the sharepoint and have it as an attachment in the email.  

 

My train of thought is to create a collection with those images in it, then be able to have an attachment with that collection, however I am unable to figure out a way to perform this.

Categories:
  • Verified answer
    amoy01 Profile Picture
    15 on at
    Re: Sending an email through PowerApps with attachments from a sharepoint list

    I fixed both issues, I guess the extension of the photos don't matter when sent. 

  • amoy01 Profile Picture
    15 on at
    Re: Sending an email through PowerApps with attachments from a sharepoint list

    Could you elaborate on using the extension from that file name? I am holding the images like this: 

    amoy01_0-1718639394405.png

    Also, another issue I found was that for the areas with less than 5 images, I would get an error saying that the attachment couldn't be null. 

  • rzuber Profile Picture
    545 Super User 2025 Season 1 on at
    Re: Sending an email through PowerApps with attachments from a sharepoint list

    The reason they come up that way is because Outlook needs the extension to know what type of file it is looking at. You have to send the correct file extension with the file name. When you put the picture in the collection, didn't it come from the sharepoint file? Use the extension from that file name.

  • amoy01 Profile Picture
    15 on at
    Re: Sending an email through PowerApps with attachments from a sharepoint list

    When I try it without the jpg, I get this: 

    amoy01_0-1718638880901.png

    Where when I download it, it says it's a File in type

  • rzuber Profile Picture
    545 Super User 2025 Season 1 on at
    Re: Sending an email through PowerApps with attachments from a sharepoint list

    It requires an attachment name, yes, but it shouldn't require that name to include 'jpg'... can't you use the original filename, or at least grab the file extension off it?

  • amoy01 Profile Picture
    15 on at
    Re: Sending an email through PowerApps with attachments from a sharepoint list

    Okay, I followed the instructions from the link, but am now having another issue. 

     

    ClearCollect(
    PicCol, {Name: "Picture1.jpg", ContentBytes: Picture1_Image.Image,'@odata.type':""},
    {Name: "Picture2.jpg", ContentBytes: Picture2_Image.Image,'@odata.type':""},
    {Name: "Picture3.jpg", ContentBytes: Picture3_Image.Image,'@odata.type':""},
    {Name: "Picture4.jpg", ContentBytes: Picture4_Image.Image,'@odata.type':""},
    {Name: "Picture5.jpg", ContentBytes: Picture5_Image.Image,'@odata.type':""}
    );

     I needed to change the name to include the '.jpg' in order for the images to show in the email. However, I realized that not all the images in the SharePoint list was a jpg image, some being png. Is there a universal way for the images to just show as their type?

  • rzuber Profile Picture
    545 Super User 2025 Season 1 on at
    Re: Sending an email through PowerApps with attachments from a sharepoint list

    Maybe this other post on this topic can help?

    Solved: send image via email - Power Platform Community (microsoft.com)

     

    Obviously SendEmail() is deprecated... but you can get help for that here: Office 365 Outlook - Connectors | Microsoft Learn

     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,658 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,999 Most Valuable Professional

Leaderboard