Skip to main content
Community site session details

Community site session details

Session Id : 2Zp5Wm5BAqbWr9Pb90ncQh
Power Automate - Building Flows
Answered

when sending email to 2 SharePoint groups, getting email triggered for 1 SharePoint group attached flow steps but no error found in the flow steps

Like (0) ShareShare
ReportReport
Posted on 15 Dec 2022 11:08:59 by 2,245

Issue details Email is getting triggered to HR SharePoint groups but email is not getting triggered for  Leaders SharePoint groups.

Veblitz_1-1671102888641.png

 

Veblitz_0-1671101302357.png

 

Veblitz_8-1671102243606.png

 

 

Veblitz_0-1671102386639.png

Veblitz_2-1671101557390.png

Veblitz_3-1671101597102.png

 

Apply to each detailed steps as per above screenshot

 

Veblitz_4-1671101765614.png

Veblitz_6-1671101896559.png

Veblitz_7-1671101968478.png

 

 

 

 

  • Veblitz Profile Picture
    2,245 on 17 Dec 2022 at 22:01:25
    Re: when sending email to 2 SharePoint groups, getting email triggered for 1 SharePoint group attached flow steps but no error found in the flow steps

    Thanks a lot for your Kind and valuable suggestions .

     

    Marked it as solution and brilliant solution

  • Veblitz Profile Picture
    2,245 on 16 Dec 2022 at 17:42:13
    Re: when sending email to 2 SharePoint groups, getting email triggered for 1 SharePoint group attached flow steps but no error found in the flow steps

    Thanks for inputs and in my case it was string that's why it caused so much errors also I would test the same and keep you posted once its fine.

     

    Apart from the above ,Finally ,I would need to only add the below step in apply to each 2 and to apply your  union expression and pass output value to email.

     

    Veblitz_4-1671212253773.png

     

    Apply to each loop(first)

     

    Veblitz_3-1671212207732.png

     

    Veblitz_2-1671212081165.png

     

    Apply to each loop 2

    Veblitz_0-1671211875884.png

     

     

     

    Veblitz_1-1671211952594.png

     

    Compose expressions :

     

    Veblitz_5-1671212484945.png

     

     

    Please correct the above flow incase if there are any thing wrong in above steps also I would test from my end and keep you informed if it worked as expected.

  • Verified answer
    Expiscornovus Profile Picture
    32,182 Most Valuable Professional on 16 Dec 2022 at 16:23:06
    Re: when sending email to 2 SharePoint groups, getting email triggered for 1 SharePoint group attached flow steps but no error found in the flow steps

    Hi @Veblitz,

     

    Just to double check. Did use Array as type for the curremail variable?

     

    In my case it is an array, not string.

     

    array_curremail.png

  • Veblitz Profile Picture
    2,245 on 16 Dec 2022 at 07:18:23
    Re: when sending email to 2 SharePoint groups, getting email triggered for 1 SharePoint group attached flow steps but no error found in the flow steps

    Thank you for your kind inputs.

     

    I validated the same and facing below list of errors ,below are my flow steps

    Overall flow steps

    Veblitz_4-1671174353070.png

     

    Step by step flow steps

     

    Veblitz_9-1671174928157.png

    Apply to each (1st loop)

     

    Veblitz_6-1671174522673.png

     

    Choosing below values in select step

    Veblitz_7-1671174577273.png

    Above steps is Apply to each2 loop inside apply to each loop step

    Issues in apply 2 each loop

    And i am facing below issues in apply to each 2 loop on below contexts

    1)While appending to array variable I am unable to see the curremail value and it is only listing group values

     

    Note: I am unable to see the curremail when trying to choose from the list and its not listed and only groups variable is getting displayed.

    Veblitz_2-1671173991300.png

    2)While adding below expression in set variable2, Outside of all the loops by using  join the values together with a semi colon character. getting below error

    join(variables('curremail'), ';')

     

    Veblitz_8-1671174659163.png

     

    Thanks in advance for all your kind suggestions.

     

     

  • Expiscornovus Profile Picture
    32,182 Most Valuable Professional on 15 Dec 2022 at 14:37:55
    Re: when sending email to 2 SharePoint groups, getting email triggered for 1 SharePoint group attached flow steps but no error found in the flow steps

    Hi @Veblitz,

     

    Yes, sorry. I was only looking at the Leaders SP Group part. 

     

    Below setup loops through the output of the Select. For each item it append the value (mail address) to the curremail Array variable.

     

    Outside of all the loops you can join the values together with a semi colon character. The expression would be:

    join(variables('curremail'), ';')

     

    If you want to use unique emails you could use this expression instead:

    join(union(variables('curremail'),variables('curremail')), ';')

     

    appendtoarrayvariable.png

  • Veblitz Profile Picture
    2,245 on 15 Dec 2022 at 13:45:44
    Re: when sending email to 2 SharePoint groups, getting email triggered for 1 SharePoint group attached flow steps but no error found in the flow steps

    Many Thanks.

    I added the above steps but i am not sure if i got to remove my another  apply to each 2 where i appended previously(pls refer above threads of step by step flow)

     

    SO, now my flow steps looks as below where i have one apply to each section and added your inputs and refer below

     

    Veblitz_0-1671111268408.png

     

    Veblitz_1-1671111348122.png

    Veblitz_2-1671111371395.png

    Veblitz_3-1671111400228.png

     

    Note: I removed my existing apply to each 2 step where I appended right

    Expected output:

    Leader sharepoint group 

    user1@abc.com

    user2@abc.com

     

    HR SharePoint group

    user1@abc.com

     

    After adding above apply 2 each steps user1,user2 received one email(i.e. Leader SharePoint group folks) email got triggered but user1@abc.com  who is also part of HR SharePoint group should receive one more email right if my point is correct or please correct me if anything wrong with my logic

     

    Veblitz_4-1671111836738.png

     

     

     

     

     

  • Expiscornovus Profile Picture
    32,182 Most Valuable Professional on 15 Dec 2022 at 13:08:15
    Re: when sending email to 2 SharePoint groups, getting email triggered for 1 SharePoint group attached flow steps but no error found in the flow steps

    Hi @Veblitz,

     

    Yes, sure. Below is an example with a Select action and a join function.

     

    1. Add a Select action. Use the results property from your Parse Json in the From field.

     

    2. Switch the Map field of the Select action to text mode (with button on the right side). Select the Email field

     

    3. Use a Set variable action. Use the expression below to join the items of the Select action outputs together with a semi colon character

     

     

    join(body('Select'), ';')

     

     

     

    select_switchmap.png

  • Veblitz Profile Picture
    2,245 on 15 Dec 2022 at 12:52:09
    Re: when sending email to 2 SharePoint groups, getting email triggered for 1 SharePoint group attached flow steps but no error found in the flow steps

    Thanks for quick inputs.

     

    Yes I checked the flow and in apply to each step its output is

     

    user@abc.com ;  

     

    May I know how to fix the issue to the existing flow of my steps?

     

    Thanks in advance.

  • Expiscornovus Profile Picture
    32,182 Most Valuable Professional on 15 Dec 2022 at 12:42:10
    Re: when sending email to 2 SharePoint groups, getting email triggered for 1 SharePoint group attached flow steps but no error found in the flow steps

    Hi @Veblitz,

     

    If you use the append to string approach and append a semi colon character at the end of every item the last item will also have a closing semi colon character. The email field will expect another email address since there is another semi colon character. However, that email address is empty/null.

     

    Can you double check if that is the case in your setup?

     

    In your case it probably is

    john@contoso.com;jane@contoso.com;

     

    While it should be:

    john@contoso.com;jane@contoso.com

     

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!