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

Create MS Teams Group Chat using CC in email(Office365)

Like (0) ShareShare
ReportReport
Posted on 8 Aug 2022 21:20:56 by 7

Hello everyone. Just getting into PowerAutomate and am trying to figure out how to send a Teams group chat message to everyone in the CC line of an email.  The top item is "When a new email arrives (V3)." If I manually enter a "Members to add" with "userID@domain.com" the group chat is created successfully and message sent. Manually entering these though defeats the purpose of what I am trying to do. I was hoping that the dynamic "CC" field from the first step would just pull over, which it will but by email address and that will not create a Teams Group Chat and it will fail. I then attempted to use the "Get User Profile (V2)" and then dynamically pull "User Principle Name," but that will only get one "UserID@domain.com" and none of the emails past the first. I can't be the first person to want to do something like this and I'm betting there is a simpler way. Any help would be very appreciated. Thanks!

 

TestforSend.jpg

I have the same question (0)
  • ERIC_A Profile Picture
    12 on 30 Sep 2022 at 22:03:33
    Re: Create MS Teams Group Chat using CC in email(Office365)

    Update

    I found my issue. I made a mistake and I didn't initialize the variable as step 1 stated. my bad 

     

     

    hi,

    Step 6 has an issue. I cannot select any name on the Name field but not sure why. According to other cases the variable is not initialized but I followed the steps you mentioned above so I am thinking a SW upgrade or a code requirement changed causing my error ?

    ERIC_A_0-1664575397351.png

     

     

  • Jflora Profile Picture
    7 on 09 Aug 2022 at 14:27:26
    Re: Create MS Teams Group Chat using CC in email(Office365)

    @WillPage - Thank you! So far so good here!  I did take out #3 only because the email input into the (When a new email arrives (V3)) will only ever be an internal email to our corporation. Now that I think about it though, if they ever change that, it would be dynamic and the PA would still run, so I may add it back in.

     

    Thank you so much for stating this in a way that, after a little bit of digging helped me figure this out. I am very green with PA but I can definitely see its potential.

  • Verified answer
    WillPage Profile Picture
    2,241 Super User 2025 Season 2 on 09 Aug 2022 at 02:26:19
    Re: Create MS Teams Group Chat using CC in email(Office365)

    I see it says you can use email addresses or IDs. Is it failing on email addresses because one or more the email addresses is not in your tenancy?

    If they all are and it's failing anyway (wouldn't surprise me to find a bug in PA) then you can do this:

     

    1. Initialise an array variable.

    2. Add a compose and put the expression split(triggerOutputs()?['body/ccRecipients'],';') in there

    3. Add a Filter array action with its input being the output from step 2 and the advanced mode condition being @endswith(item(), 'mydomain.com') where mydomain.com is your internal domain name. This is to filter out external people who you can't start a group chat with

    4. Add an Apply to each using the output of the Filter array action as its input

    5. Inside the Apply to each add a Get User Profile (V2) action using the Current item from dynamic content (or items('Apply_to_each') as an expression if it's not there)

    6. Still in the Apply to each, go Append to array variable and append the id dynamic content from the action above

    7. After the Apply to each loop, add a Join action and join the array variable on a semicolon character

    8. Use the output of the Join in your Teams action.

     

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Tom Macfarlan – Community Spotlight

We are honored to recognize Tom Macfarlan as our Community Spotlight for October…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 664 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 400 Moderator

#3
chiaraalina Profile Picture

chiaraalina 290

Last 30 days Overall leaderboard
Loading complete