web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Automate
Answered

Reply to an email

(0) ShareShare
ReportReport
Posted on by 9

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

 

 

Categories:
  • VictorIvanidze Profile Picture
    13,083 on at

    Hi @nldenic,

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

  • nldenic Profile Picture
    9 on at

    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 

  • Verified answer
    grantjenkins Profile Picture
    11,063 Moderator on at

    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.

     

  • nldenic Profile Picture
    9 on at

    This is what i was looking for! 

     

    Thanks its now working !

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 432

#2
11manish Profile Picture

11manish 313 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 154

Last 30 days Overall leaderboard