cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mithushalk
Helper IV
Helper IV

Send multiple emails from SharePoint list

Hi, need help in fixing my flow,

I am building a flow to send email to the teams based on the form response. 
I am able to send email, if user chooses only 1 option but when user chooses 2 or more options email isn't processing.
Flow runs successful but mail won't be delivered.

 

Question in the form

mithushalk_1-1622573391348.png

 

My List on the SharePoint

 

mithushalk_0-1622573347219.png

My Flow 

mithushalk_2-1622573540695.png

Filter Query - 

replace(replace(outputs('Project_Collect_Response')?['body/rede014bb885a4ad4b331cd09384a409c'],'["',''),'"]','')


Email To - 
outputs('Get_items')?['body/value']?[0]?['Team_x0020_Email_x0020_Address']
 
Please help me how can I proceed with this?
37 REPLIES 37
mithushalk
Helper IV
Helper IV

Hi @PrasadAthalye 
I appreciate your assistance. 

I see some errors still occurring in the flow. 

By any chance can we get on a call to discuss & sort the issue? 

@mithushalk Please provide your errors and go through my previous comments.  Community thread communication is the recommended and available option to resolve issues. I request you to go through solution and last comment and follow the logic. Bring Email action out of for each loops and test..

Please Like and Mark this as Answer if it resolves your Issue.

Power Automate Community
mithushalk
Helper IV
Helper IV

Hi @PrasadAthalye 

I followed the steps as mentioned in the above message. 
I have used send an email separately outside the loop.

Expressions I used :

JSON - 

json(outputs('Project_Collect_Response')?['body/rede014bb885a4ad4b331cd09384a409c'])
 
Split - 
split(body('Join'),',')
 

mithushalk_0-1623044062264.png


Under 'Apply to each 5' I am unable to add the column name for Append to string variable value (List on SharePoint used to pick the email address) & Value because Get Items 5 isn't populating in the dynamic content.

mithushalk_1-1623044271689.png

 

  • Move Apply to each 5 inside apply to each 3, right below Get Items.
  • Then Select Value from Get Items in the 'Select an output from previous steps' box inside Apply to each 5.
  • Now in the variable, you should be able to select email property...

Hope it helps...

Please Like and Mark this as Answer if it resolves your Issue.

Power Automate Community
mithushalk
Helper IV
Helper IV

@PrasadAthalye 

I did exactly the same.
The flow was successful but the email wasn't delivered.

mithushalk_0-1623081212404.png


Append to String variable isn't working. I gave my column name from the dynamic content (Team Email Address)
Maybe, that's the reason To field is empty in Send an email.

mithushalk_1-1623081417614.png

 

Looks to me like GetItems 5 did not return any data. Can you expand that for the last run and see what was the filter criteria and the output?

Please Like and Mark this as Answer if it resolves your Issue.

Power Automate Community
mithushalk
Helper IV
Helper IV

@PrasadAthalye 

mithushalk_0-1623091945281.png



Filter Query is picking up the proper response but email address is picked up.

mithushalk_1-1623092202845.png

 

Okay..  Please check the value in Filter. It should be only legal. Why does it have all of them seperated by dot? 

 

Can you upload your Join and Compose Output. Problem lies there. It is not creating array correctly ...

Please Like and Mark this as Answer if it resolves your Issue.

Power Automate Community
mithushalk
Helper IV
Helper IV

@PrasadAthalye 

Yes, that's correct in the filter query because in the form I chose all 3 options so the outcome must be emails delivered to all 3 email addresses.

JSON - json(outputs('Project_Collect_Response')?['body/rede014bb885a4ad4b331cd09384a409c'])
Compose - split(body('Join'),',')
Output - Outputs('Compose')

mithushalk_0-1623096293453.png

 

Please upload run screen shot. I would like to see output of Compose. It should be an array.

Please Like and Mark this as Answer if it resolves your Issue.

Power Automate Community
mithushalk
Helper IV
Helper IV

@PrasadAthalye 

Since I chose all 3 options in the form it's populating correct, I guess.

mithushalk_0-1623125883671.png

 

Your split function is not working...

 

What is the seperator you used? I see that you have used dot to join. Can you change seperator in both as comma and test again. Output of Compose should be an array and you need comma for it.

Please Like and Mark this as Answer if it resolves your Issue.

Power Automate Community
mithushalk
Helper IV
Helper IV

@PrasadAthalye 

Yes, in JOIN I used . for 'Join with' since I can't skip that question. 
if I need to replace it then can you please mention what can I add there?

Compose - split(body('Join'),',')

mithushalk_0-1623156669048.png

 

Use comma at both places...

Please Like and Mark this as Answer if it resolves your Issue.

Power Automate Community
mithushalk
Helper IV
Helper IV

@PrasadAthalye 

I added Comma for Join within JOIN. 
Where exactly am I supposed to add a comma in the split?

Compose - split(body('Join'),',')

Can you please specify that or show a demo

 

mithushalk
Helper IV
Helper IV

@PrasadAthalye 
Flow is able to pick all 3 email addresses but threw an error in delivering.

Error details
The 'inputs.parameters' of workflow operation 'Send_an_email_(V2)_2' of type 'OpenApiConnection' is not valid. Error details: Input parameter 'emailMessage/To' is required to be of type 'String/email'. The runtime value '".xyz@yz.com;xyz@bc.com;adc@ab.com;"' to be converted doesn't have the expected format 'string/email'.

You can just see there is a . in front of the first email address but I checked thoroughly & confirmed that there's no any . I have added to the expressions.

mithushalk
Helper IV
Helper IV

Hey @PrasadAthalye 

I was able to figure the issue. 
Thanks a ton for the assistance.

So Is the solution working fine? If yes, can you accept the solution to close the thread?

Please Like and Mark this as Answer if it resolves your Issue.

Power Automate Community

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (2,008)