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

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Send email on new Team...
Power Automate
Unanswered

Send email on new Teams message, include File attachment.

(0) ShareShare
ReportReport
Posted on by 34

Hello all:

 

I am working with this example:

 

Send an email when a new message is added in Microsoft Teams | Microsoft Power Automate

 

and I need to be able to include an uploaded file from the Teams channel, but the email I am getting looks like this without the attached file:

Message From: John Straumann

Importance: normal

Body: Please process my application<attachment id="c3526e61-a5ec-4759-b45c-ead956eb0dae"></attachment>

 

Does anyone know how I can send the attachment from Teams?

Categories:
I have the same question (0)
  • v-LilyW-msft Profile Picture
    on at
    Re: Send email on new Teams message, include File attachment.

    Hi @JohnStraumannPA 

    Accroding to your description, you want to send an email with an attachment when a new message is added:

    I set up a flow, you can take a try with the following steps.

    vLilyWmsft_0-1626763015138.png

    vLilyWmsft_1-1626763015141.png

    vLilyWmsft_9-1626763170106.png

    Expression:split(item()?['contentUrl'],'lilyteam')[1]

    Note: ‘lilyteam’ is my Team name

    vLilyWmsft_10-1626763203210.png

    vLilyWmsft_4-1626763015150.png

    Expression: base64(body('Get_file_content_using_path'))

    vLilyWmsft_5-1626763015157.png

    vLilyWmsft_6-1626763015161.png

    When a new message is added with file

    vLilyWmsft_7-1626763015162.png

    I will receive an email:

    vLilyWmsft_8-1626763015163.png

    Hope the content above may help you.

    Best Regards

    If my solution helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • JohnStraumannPA Profile Picture
    34 on at
    Re: Send email on new Teams message, include File attachment.

    thanks for your reply, Lily. I sent an email to your Microsoft email address, PLMK if you do not receive it.

  • JohnStraumannPA Profile Picture
    34 on at
    Re: Send email on new Teams message, include File attachment.

    Hi Lily: I don't understand the AttachName step in the Apply to Each action, what action do I sue for that? When I searched AttachName I get no results, is AttachName another variable I need to set up? The only variable I see in your steps is Attachment?AttachName.PNGAttachName2.PNG 

  • v-LilyW-msft Profile Picture
    on at
    Re: Send email on new Teams message, include File attachment.

    Hi @JohnStraumannPA 

    This Action is Compose Action, in order to distinguish it well, I renamed its name to 'AttachName'.

    The same for 'FilePath'.

    vLilyWmsft_0-1626828012038.png

    Best Regards.

  • JohnStraumannPA Profile Picture
    34 on at
    Re: Send email on new Teams message, include File attachment.

    For the "Get File Content Using Path" step, did you create a new Sharepoint site or/ And what is the Outputs component shown in the screens? Is that a variable or?Outputs.PNGOutputs1.PNG

     

    I am hitting an error on the send step:

    RunError.PNGRunError1.PNGApplyToEach.PNGApplyToEachFilePath.PNG

  • Verified answer
    v-LilyW-msft Profile Picture
    on at
    Re: Send email on new Teams message, include File attachment.

    Hi @JohnStraumannPA 

    1/When you create a team in Microsoft Teams, the system will automatically create a site with the same name in Sharepoint.

    So you don't need to create a new Sharepoint site. You can select the site with the same name in Team in Trigger from the drop-down menu in 'Get file content using path' Action.

    vLilyWmsft_0-1626932318318.png

    2/The Outputs in the figure below is the output of the 'FilePath' above it.

    vLilyWmsft_2-1626932766491.png

    You can enter the content in the search box of dynamic content that you are looking for.

    vLilyWmsft_3-1626932900309.png

    Best Regards.

  • bkladd Profile Picture
    2 on at
    Re: Send email on new Teams message, include File attachment.

    In case someone else comes across this post, I was banging my head against the wall trying to make this work. In my case, the key was to prefix the File Path with "/Shared Documents/General/" as shown below.

     

    bkladd_0-1643827128056.png

     

    Also, the name of the site referenced in the split(item).... expression is case sensitive.

     

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 Automate

#1
Tomac Profile Picture

Tomac 497 Moderator

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 477 Super User 2025 Season 2

#3
chiaraalina Profile Picture

chiaraalina 242

Last 30 days Overall leaderboard