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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Adding Attachment (Ima...
Power Apps
Answered

Adding Attachment (Image) to Email when already have a Concat Formula

(0) ShareShare
ReportReport
Posted on by 1,176

Hi,

I'm wanting to send an email out with an image and some information.

I have a Concat formula already which details the information.  I

 

now want to add an attachment to the email that relates to the information. The Concat formula is 

 

Office365.SendEmail(
"Email address", (Receptiant email is included in original formula)
"Perimeter Check Issues",
Concat(Perimeterissue,
"Building: " & Building & Char(10) &
"Area: " & Title & Char(10) &
"Comments: " & Comments & Char(10),
"Issue: " & Issue & Char(10) & Char(10)
)
)

'Perimeterissue' is the name of my collection which also contains the image. 

 

The Collection is triggered by Clicking on the Camera function

 

Collect(
Perimeterissue,
{
Title: txtChecklistSpecificArea.Text,
Image: txtChecklistSpecificArea.Text & " .jpg",ContentBytes:Camera1.Photo,'@odata.type':"",
Hint: txtChecklistDescription.Text,
Building: drpSelectedBuilding.Selected.Result,
Issue: RadChecklist.Selected.Value,
Comments: txtChecklistComments.Text,
CheckedBy: txtCheckedBy.Text,
Date: txtDate.Text,
Time: txttime.Text
}
);
Reset(RadChecklist);
Reset(txtChecklistComments);

 

Any assistance would be grateful

Categories:
I have the same question (0)
  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    HI @ClarkyPA365 

     

    Can you try to update your expressions as:
     
    Collection Creation:
     
    Collect(
    Perimeterissue,
    {
    Title: txtChecklistSpecificArea.Text,
    Name: txtChecklistSpecificArea.Text & " .jpg",ContentBytes:Camera1.Photo,'@odata.type':"",
    Hint: txtChecklistDescription.Text,
    Building: drpSelectedBuilding.Selected.Result,
    Issue: RadChecklist.Selected.Value,
    Comments: txtChecklistComments.Text,
    CheckedBy: txtCheckedBy.Text,
    Date: txtDate.Text,
    Time: txttime.Text
    }
    );
    Reset(RadChecklist);
    Reset(txtChecklistComments);
     
    Attachments in the outlook connector expects its columns to be Name and ContentBytes.
     
    Send Email:
     
    Office365.SendEmail(
    "Email address", (Receptiant email is included in original formula)
    "Perimeter Check Issues",
    Concat(Perimeterissue,
    "Building: " & Building & Char(10) &
    "Area: " & Title & Char(10) &
    "Comments: " & Comments & Char(10),
    "Issue: " & Issue & Char(10) & Char(10)
    ),
    {Attachments:ShowColumns(Perimeterissue,"Name","ContentBytes")}
    )
     
     
    This will add the attachments in your email. This supports more than 1 attachment based on the collection.
     
    Hope this Helps!

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
  • Chris1968 Profile Picture
    1,176 on at

    Hi @yashag2255 

    Thanks for your reply.

    I've amended my formulas to the changes you have hi-lighted.

     

    The send email formula is show red underlining

    Office365.SendEmail(
    "Email",
    "Perimeter Check Issues",
    (Concat(Perimeterissue,
    "Building: " & Building & Char(10) &
    "Area: " & Title & Char(10) &
    "Comments: " & Comments & Char(10) &
    "Issue: " & Issue & Char(10) & Char(10)
    ),
    {Attachments:(Perimeterissue,"Name","ContentBytes")}
    )

    Where you have emoji and howcolumns what needs to be here? 

  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    @ClarkyPA365 '

     

    Can you try with this?

     
    Collect(
    Perimeterissue,
    {
    Title: txtChecklistSpecificArea.Text,
    Name: txtChecklistSpecificArea.Text & " .jpg",ContentBytes:Camera1.Photo,'@odata.type':"",
    Hint: txtChecklistDescription.Text,
    Building: drpSelectedBuilding.Selected.Result,
    Issue: RadChecklist.Selected.Value,
    Comments: txtChecklistComments.Text,
    CheckedBy: txtCheckedBy.Text,
    Date: txtDate.Text,
    Time: txttime.Text
    }
    );
    Reset(RadChecklist);
    Reset(txtChecklistComments);
     
    Attachments in the outlook connector expects its columns to be Name and ContentBytes.
     
    Send Email:
     
    Office365.SendEmail(
    "Email address", (Receptiant email is included in original formula)
    "Perimeter Check Issues",
    Concat(Perimeterissue,
    "Building: " & Building & Char(10) &
    "Area: " & Title & Char(10) &
    "Comments: " & Comments & Char(10),
    "Issue: " & Issue & Char(10) & Char(10)
    ),
    {Attachments: ShowColumns(Perimeterissue,"Name","ContentBytes")}
    )
     
    Hope this Helps!

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
  • Chris1968 Profile Picture
    1,176 on at

    Hi @yashag2255 

    Thanks for that couldn't find a formula howcolumns.  Not sure why the emoji displays in the community form but not in the email I get???

    I still seem to be getting an error against th last 'Comma' before the curly brace {Attachment........ 

     

    Error Msg Unexpected characters. The formula contains 'ParenClose' where comma is expected.

  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hi @ClarkyPA365 

     

    I think the error is occurring because of the body passed in email, there is a comma in between which might cause this issue. Can you try below expression:
     
    Office365.SendEmail(
    "Email address",
    "Perimeter Check Issues",
    Concat(Perimeterissue,
    "Building: " & Building & Char(10) &
    "Area: " & Title & Char(10) &
    "Comments: " & Comments & Char(10) &
    "Issue: " & Issue & Char(10) & Char(10)
    ),
    {Attachments: ShowColumns(Perimeterissue,"Name","ContentBytes")}
    )
     
    Hope this Helps!
     
    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
  • Chris1968 Profile Picture
    1,176 on at

    Hi

     

    Still getting the last comma underlined in red and the same error message?

     

    Office365.SendEmail(
    "Email",
    "Perimeter Check Issues",
    (Concat(Perimeterissue,
    "Building: " & Building & Char(10) &
    "Area: " & Title & Char(10) &
    "Comments: " & Comments & Char(10) &
    "Issue: " & Issue & Char(10) & Char(10)
    ),
    {Attachments:ShowColumns(Perimeterissue,"Name","ContentBytes")}
    )

     

     

     

  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    @ClarkyPA365 

     

    Can you please share a screenshot? (of the error message and the expression on the control)

  • Chris1968 Profile Picture
    1,176 on at

    Hi,

    I've attached two screenshots showing the formula without the error msg and one with the error msg

    Expression.PNG
    Error msg.PNG
  • Verified answer
    Chris1968 Profile Picture
    1,176 on at

    Hi 

    Solved it.

    I had a opening bracket before the Concat.  Doh!!!!!

    Removed that and it works perfectly. 

    Thanks for your help

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 296 Most Valuable Professional

#2
11manish Profile Picture

11manish 224

#3
Valantis Profile Picture

Valantis 181

Last 30 days Overall leaderboard