Issue details Email is getting triggered to HR SharePoint groups but email is not getting triggered for Leaders SharePoint groups.
Apply to each detailed steps as per above screenshot
Thanks a lot for your Kind and valuable suggestions .
Marked it as solution and brilliant solution
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.
Apply to each loop(first)
Apply to each loop 2
Compose expressions :
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.
Hi @Veblitz,
Just to double check. Did use Array as type for the curremail variable?
In my case it is an array, not string.
Thank you for your kind inputs.
I validated the same and facing below list of errors ,below are my flow steps
Overall flow steps
Step by step flow steps
Apply to each (1st loop)
Choosing below values in select step
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.
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'), ';')
Thanks in advance for all your kind suggestions.
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')), ';')
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
Note: I removed my existing apply to each 2 step where I appended right
Expected output:
Leader sharepoint group
HR SharePoint group
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
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'), ';')
Thanks for quick inputs.
Yes I checked the flow and in apply to each step its output is
May I know how to fix the issue to the existing flow of my steps?
Thanks in advance.
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