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 Automate / Trouble Creating a Tea...
Power Automate
Unanswered

Trouble Creating a Teams Group with data from a 'Person' field (multiple entries) in a Sharepoint list

(0) ShareShare
ReportReport
Posted on by 15

I have created a power app that allows someone to tag multiple users within the organisation when creating a new collaboration project. 

 

I want to create a flow that takes those names and creates a Teams group with them, and then posts info from fields into that group chat.

 

Where I am getting unstuck is that every time I call the Claims from that field, it creates an 'Apply To Each' action, which I don't get how to use. I think I need to turn that into an array and split out the names, and use that variable to populate the addressees list in the Teams group creation action, but I don't know how to do that! I'm getting very stuck!

 

Is my issue in the field in the sharepoint list? Should it be something other than a person field? I have it set as multiple entries and groups can be selected, and I am using their claim, not their email... Should I do that part differently? I want to be able to have a user select form a list their collaboration partners...

 

Your help would be appreciated!

Categories:
I have the same question (0)
  • SanmeshG Profile Picture
    1,947 Moderator on at

    Hi @Jo_Leu  ,

     

    Can you add the screenshots of your flow ? As you mentioned you are using a multi-select person or group column. It will automatically go into an apply to each loop , which is expected. And the loop will have a value array which will include all the properties such as DisplayName , Email , Claims.

     

    So if you are using create a team action , then you can use Add a member to a team action(which takes email ID for adding the member to a Team) to add users to the team.

     

    Hope this helps!

     

    Thanks,

     

  • Caspar_Rubin Profile Picture
    831 on at

    Hey @Jo_Leu 

     

    You're correct, the "Apply to each" gets applied automatically because Power Automate knows, that there could be multiple people in the SharePoint item column.

     

    It basically loops every user of your SharePoint List item. You must use the "Apply to each" to add the users, it's not possible without it... 

     

    For example, your SharePoint list might look like this:
    I have a MultipleUser field with two Users: Caspar and Manuel.

    Caspar_Rubin_0-1692097698636.png

     



    Now in Power Automate, I simply use the Apply to each loop to add the users to the m365 (teams) group.

    If I select the Claims value, it automatically wraps the "Add member to group" action in an "Apply to each" loop. That's perfect, we don't have to do it ourselves.

    This way, the action will trigger twice, once for every user. Fist it adds Caspar, then Manuel. That's it. 🙂

     

    Caspar_Rubin_1-1692097772501.png

     

    cheers

  • Jo_Leu Profile Picture
    15 on at

    Here's what i tried...

     

    Screenshot 2023-08-16 at 5.14.36 pm.png

     

    But it's giving this error:

    "Flow save failed with code 'InvalidTemplate' and message 'The template validation failed: 'The inputs of template action 'Post_message_in_a_chat_or_channel' at line '1 and column '2165' is invalid. Action 'Apply_to_each' must be a parent 'foreach' scope of action 'Post_message_in_a_chat_or_channel' to be referenced by 'repeatItems' or 'items' functions.'.'."

  • Jo_Leu Profile Picture
    15 on at

    @SanmeshG 

    Posted it below... 😊

  • Caspar_Rubin Profile Picture
    831 on at

    Hey @Jo_Leu 

     

    It seems like i misunderstood, i though you want to add the users to a membership group, not a chat group....

     

    To create a chat with multiple people from the SharePoint list column, you can do that like this:

    Caspar_Rubin_0-1692176209518.png

     

    First, create a new variable by using the "Initialize variable" action. Give it a name like "UsersEmailAddresses" and choose the Type "String". Leave the "Value" field empty for now.

     

    Then, add a "Append to string variable" action. Select the "UsersEmailAddresses" at "Name" and as the Value, choose the "Email" Dynamic content from your "When an item is created" trigger.

    This will automatically wrap a "Apply to each" around the action. This way, you'll have a variable with all the Email Addresses.
    Important: Don't forget to manually add a Semicolon (;) after Dynamic content value...

     

    Caspar_Rubin_1-1692176406552.png

     

    After that, you can simply add your "Create chat" and "Post message in chat or channel" actions outside the "Apply to each" loop to complete your flow.


    Make sure you use the Variable in the "Members to add" field:

    Caspar_Rubin_2-1692176479874.png


    And in your "Post message in a chat or channel" action, you might have to click on "Enter custom value", before you can add the "Conversation Id" from your "Create a chat" action...

     

    Caspar_Rubin_4-1692176665091.png


    Once you press "Enter custom value", you can then select "Conversation Id" from the Dynamic content pop-up.

    Caspar_Rubin_5-1692176740288.png


    let us know if this works, cheers

     

     



  • Jo_Leu Profile Picture
    15 on at

    Thanks! That's making much more sense... It's still throwing an error though - see the screenshot... (I did remember to put the semicolon in though 😁)

    Screenshot 2023-08-17 at 11.09.46 am.png

  • Caspar_Rubin Profile Picture
    831 on at

    Hey,

     

    is your email address (the email address the action is using) in the list of people in the "Members to add" field? If you add yourself, it will fail.

     

    Caspar_Rubin_0-1692255304804.png

     

     

     

  • Jo_Leu Profile Picture
    15 on at

    This is helping me learn lots, but still not getting there 🙁

     

    I found another option to try to solve it, using the 'Get User (V2)' action for Office365, and that is still throwing the same error. I have definitely made sure that my email is not being added to the list it's creating. 

     

    I've also tried it with display names or UPN and that's not working either... See my new screenshots...

     

    Screenshot 2023-08-21 at 4.15.58 pm.png

    Screenshot 2023-08-21 at 4.16.25 pm.png

    Screenshot 2023-08-21 at 4.16.30 pm.png

  • Jo_Leu Profile Picture
    15 on at

    Hey @Caspar_Rubin  - I'm just back from leave and I was wondering if you had any insights for this still? ⤴️

     

    Could it be a permissions issue at the Teams end? Or something in the set up of our own system? I have tried flows with UPNs, emails, just about everything I can think of. The field in the Sharepoint list isn't calling the creator's username/email as far as I can tell, so I doesn't seem to be that... Any other ideas?

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
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard