cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
nldenic
New Member

Reply to an email

Hi Users,

 

I want to reply to an mail that arrives in an shared mailbox. This reply should be specefic text for the specefic receiver.

 

So when an receiver alias is Test@test.nl it should reply with the correct details from the excel row.

 

And when the mail has been send to test1@test.nl it should reply with the test1 row text.

 

For now its  working when someone send and email to an alias from an shared mailbox and if the to: field contains 1 email adres. 

 

But when there is more email adresses in the to: Field its not working.

 

Can someone help me with this?

nldenic_0-1667922878906.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
grantjenkins
Community Champion
Community Champion

You will need to loop through each of the emails and check each one in your Excel file. I've created a quick example.

 

I'm using the following Excel Table.

grantjenkins_8-1667973395410.png

 

The full flow is below. I'll go into each of the actions.

grantjenkins_0-1667972124690.png

 

When a new email arrives is the same as what you have:

grantjenkins_1-1667972159964.png

 

I then use a Select to get each of the email addresses and add them to an array that we can loop over. The expressions I use for this are:

split(triggerOutputs()?['body/toRecipients'], ';')

item()

grantjenkins_2-1667972239748.png

 

This will give us an array of email address similar to below:

[
  "grantjenkins@happywolf.onmicrosoft.com",
  "AdeleV@happywolf.onmicrosoft.com"
]

 

Next, we have an Apply to each that loops over each email address in our array.

grantjenkins_3-1667972963232.png

 

It will "try" to Get a row in the Excel Table that matches the current email address. If it doesn't find a match, then this action will cause an error. This is why we have the Terminate action after the loop which I'll explain later. If it does find a match, then we Send an email with the content returned from Get a row.

grantjenkins_4-1667973099558.png

 

After the loop we have a Terminate action set to Status of Succeeded.

grantjenkins_5-1667973193689.png

 

An important step here is to Configure run after on it so that it runs when the previous action either succeeds or fails. To do this we go into the Configure run after of the Terminate action.

grantjenkins_6-1667973274239.png

 

Then we check both is successful AND has failed, then click on Done.

grantjenkins_7-1667973325674.png

 

This should get what you are after.

 



----------------------------------------------------------------------

If I've answered your question, please mark the post as Solved.

If you like my response, please consider giving it a Thumbs Up.

View solution in original post

4 REPLIES 4
VictorIvanidze
Community Champion
Community Champion

Hi @nldenic,

you have to retrieve all addresses from ToRecipients and CcRecipients and select one that is assigned to your shared mailbox.

--------------------------------------------------------------------------------------
Contact me if you are interested in custom Power Automate development.

Thank you for your fast reply 

 

so now its working if the to field contains the alias that is also in the row in excel. But when its 2 or more alias in the to field its broken and not able to Find the value in the row because its written like test@test.nl;test1@test.nl

 

so i neef to find an method to find the alias in the to field and Search in excel to send specific mail that is written in the excel row 

grantjenkins
Community Champion
Community Champion

You will need to loop through each of the emails and check each one in your Excel file. I've created a quick example.

 

I'm using the following Excel Table.

grantjenkins_8-1667973395410.png

 

The full flow is below. I'll go into each of the actions.

grantjenkins_0-1667972124690.png

 

When a new email arrives is the same as what you have:

grantjenkins_1-1667972159964.png

 

I then use a Select to get each of the email addresses and add them to an array that we can loop over. The expressions I use for this are:

split(triggerOutputs()?['body/toRecipients'], ';')

item()

grantjenkins_2-1667972239748.png

 

This will give us an array of email address similar to below:

[
  "grantjenkins@happywolf.onmicrosoft.com",
  "AdeleV@happywolf.onmicrosoft.com"
]

 

Next, we have an Apply to each that loops over each email address in our array.

grantjenkins_3-1667972963232.png

 

It will "try" to Get a row in the Excel Table that matches the current email address. If it doesn't find a match, then this action will cause an error. This is why we have the Terminate action after the loop which I'll explain later. If it does find a match, then we Send an email with the content returned from Get a row.

grantjenkins_4-1667973099558.png

 

After the loop we have a Terminate action set to Status of Succeeded.

grantjenkins_5-1667973193689.png

 

An important step here is to Configure run after on it so that it runs when the previous action either succeeds or fails. To do this we go into the Configure run after of the Terminate action.

grantjenkins_6-1667973274239.png

 

Then we check both is successful AND has failed, then click on Done.

grantjenkins_7-1667973325674.png

 

This should get what you are after.

 



----------------------------------------------------------------------

If I've answered your question, please mark the post as Solved.

If you like my response, please consider giving it a Thumbs Up.

This is what i was looking for! 

 

Thanks its now working !

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (2,819)