Wednesday, January 26, 2022

Power Automate: How to Send an email with options from a Shared Mailbox

Must read

Rik de Koning
My name is Rik de Koning and I work as a Functional Consultant for Portiva, which is one of the larger Office 365 implementation partners in The Netherlands. I started my career in 2011 as a SharePoint support engineer and in 2013, I went to become a SharePoint consultant where I did various projects on SharePoint Server 2010 and SharePoint Server 2013. In the last couple of years I started focusing more and more on Office 365, especially on SharePoint Online, PowerApps and Microsoft Flow. I like being challenged and for PowerApps and Flow being quite new, there are always some challenges when implementing these services. When I’m not working, I like spend some time with my family (girlfriend and son), hang out with friends, do some sports (like fitness, running, kitesurfing and snowboarding) playing videogames and just relax a little. If you have any questions, please do not hesitate to contact me!



With the Send email with options action in Power Automate, you can send an email to a user with a respond option and wait for completion.
Unfortunately, this email cannot be sent from a shared mailbox by default.

There are several user voices out there and some of them are actually ‘Under Review’ but until Microsoft has incorporated this into the action, I will explain how you can send the email with options from a shared mailbox.

The solution consists of sending out the mail with options like you usually do and re-sending the email from a shared mailbox.

So for this to work, you need to configure two flows:

  1. The flow that sends out the initial mail with options from the flow owner (or the one who’s connection is used)
  2. The flow that re-sends the mail with options from the shared mailbox

This is basically the same mail with options you configure normally, except for the following changes:

  • The email needs to be sent to the shared mailbox that eventually will send the mail with options to the final recipient



(Shared Mailbox is just the name of my test shared mailbox in this case)

  • The subject needs to be altered to that the second flow knows which mail needs to be resent and where to send the email to. More on this below

Altering the subject

For the second flow to know which mail needs to be sent and where to send the mail to, an alteration needs to be made to the subject of the initial mail with options:

  1. Assigning an unique identifier to the subject of the mail so that you can filter out the email from any other mail that arrives in the shared mailbox
  2. Including the Recipient and (if applicable) the Carbon Copy (CC)/Blind Carbon Copy (BCC)
  3. Including the actual subject

I put all of these alteration properties into string variables so that I can access them easily.

Assigning an unique identifier

This is something you can think of yourself, as long as you’re certain that this unique identifier is not used inside any other emails that will arrive at the shared mailbox. I used SHAREDMAILBOXMAILWITHOPTIONS for this:



Including the Recipient and CC/BCC

In this example I only use To and CC recipients.
These variables contain the actual recipient and the actual CC:



(I only have one user in my tenant, so that’s why I use the same email address several times. You can also use dynamic content ofcourse!)

Including the actual subject

The same method applies for the subject, just initialize another variable that includes the actual subject:



Putting it all together

Now it’s time to put all of this information together and make sure to separate the various properties from each other. I used another variable for this:



These are all of the properties we configured earlier, separated using double pipe symbols (||). You can choose whatever separator you want to use, as long you’re certain it’s unique for separating (e.g. a semicolon isn’t unique because that’s used also for separating recipients in the To and/or CC variables).

You also need to assign identifiers to your properties so you can filter them out in your second flow. I used the following identifiers:

  • To: for the recipient
  • CC: for the CC
  • Subject: for the subject

Make sure there is a separator in there as well (different from the other separator ), because we need to split the identifiers from the action values as well later on. As you can see, I used a colon (:) for this.

Finalizing the send mail with options action

Not that our altered subject is fully configured, we can proceed by completing our Send mail with options action. As said, it’s basically the same configuration as you would normally do, except the recipient and the subject are different:



Sending the mail with options, results in receiving the following email:



As you can see, the mail with options is sent from a personal account (mine in this case), to the shared mailbox and with the altered subject.

Now that we have completed the initial mail with options and sent it to the shared mailbox, we now need to make sure the email is being resend to the correct recipient(s), with the correct subject. We do that using a second flow.

Identifying the mail with options from the shared mailbox

The trigger for this second flow is the When a new email arrives in a shared mailbox (V2) trigger. Within this trigger you need to configure the following attributes:

  • Which shared mailbox to look in. In my case this is the Shared Mailbox mailbox
  • In which folder to look for the email. If you use a Rule to move the mail with options to a specific folder on arrival, you need to select that folder. In my case, I don’t use a Rule for this so the email arrives in the Inbox folder and I did’t need to change that
  • Which subject to filter on. In this case we used SHAREDMAILBOXMAILWITHOPTIONS as an unique identifier so that will be our subject filter.
    Please note: you cannot use AND/OR statements within this filter option. You can only filter on one attribute



Filter out the recipient(s) and subject

Now that we have identified our mail with options, we need to filter out the To, CC and Subject attributes from the subject. To do this, we must do the following:

  1. Separate all of the attributes into an array
  2. Filter the array on the specific attributes
  3. Split the prefixes (To:, CC: and Subject:) from the actual values that we want to use
Separating the attributes

For this, we can use the initialize variable option to initialize a new array variable. The Value of this variable is the subject of the email, split by the separator we configured in our first flow (which are the double pipes: ||):




When running the flow, you will see that the outcome of the action will separate each attribute:



Filter out the attributes

Now that we have our array filled with all attributes, it’s time to filter this array to get all of the attributes. I use a parallel branch for this so that all attributes are filtered out simultaneously and added the Filter array action to each of the parallel branch.

The array we want to filter is our arrFullSubject variable we just initialized. We want to filter out the row that contains To: for our recipient, the row that contains CC: for our CC and the row that contains Subject: for our subject. Each row of our variable (except for the first row that contains the unique identifier), starts with on of these values so we can use the startsWith() expression. The startsWith() expression expects two attributes:

  1. The item that we need to check, which is the item() attribute in your expression builder
  2. The value we are checking for, which is the To:, CC: or Subject: string

This results into the following expressions:







This expression needs to be true to get a positive match:



Split the prefix from the actual value

Now that we have filtered our array into the separate attributes we are looking for, we need to make sure to only get the actual values and not the To:, CC: and Subject: prefixes.

First I initialized three more variables at the start of the flow that will store the values eventually:

  • varTo
  • varCC
  • varSubject

To do that, we must use the split() expression to split the array into the actual value and prefix, using the colon (:) separator. Because the actual value is the last attribute of our split array, we need to use the last() expression to get this value:


Since we are still using using an array (filtering out an array results into a filtered array, because you can still have multiple items after filtering) and splitting only works on a string, we need to fetch the first item inside our filtered array (because we only have one item inside the filtered array) and perform our split() action on that value. The entire expression for the recipient value will look like this:


You need to alter the expression three times to make sure the values from the recipient, CC and subject are being used:



Re-sending the mail with options from the Shared Mailbox

Now that we have all of our values stored into variables, we can proceed by sending the mail with options from our shared mailbox by simply adding a Send an email from a shared mailbox (V2) action and assigning the following attributes:

  • Mailbox Address: the shared mailbox you want to send the mail with options from (in my case, this is the Shared Mailbox mailbox)
  • To: our varTo variable
  • CC: our varCC variable
  • Subject: our varSubject variable
  • Body: the body from the email we identified using the trigger. You can use the Dynamic Content attribute Body for this.
    Make sure you enable the HTML view of your body, otherwise your body may fail to render correctly 
  • Importance: the importance of the email we identified using the trigger. You can use the Dynamic Content attribute Importance for this



Deleting the initial mail with options

Now that the mail with options is sent to the correct recipient(s) with the correct subject, we can now delete the initial mail with options from our shared mailbox. You can do this by adding the Delete email (V2) action and setting the Message Id property of the action to the Message Id of the email we identified using the trigger. You can use the Dynamic Content attribute Message Id for this.



With this in place, our second flow is complete and will now take care of sending your mail with options from a shared mailbox:



As you can see, the mail with options is now sent from the shared mailbox, to the correct recipient(s) and with the correct subject.

One final note: make sure that the account that is used for the following triggers and actions has access to the shared mailbox:

  • When a new email arrives in a shared mailbox (V2)
  • Send an email from a shared mailbox (V2)
  • Delete email (V2)

More articles


  1. Hi, then afterwards how do I get the feedback of the User’s option in my flow? I tried your way, there is no ‘SelectedOption’ to choose from? any suggestion on this? thank you in advance.

  2. Hi, could you please advise on how to get the selected option feedback after the option is selected by the receiver? and also if there were two flows, how can they share the same variables…as an environment variable? but seems not to be working for my case. appreciate your help

  3. Hi, nice tutorial, works fine in the “basics”- when you want to add dynamic content in the first Flow, it gets a bit more difficult.

    I added a Get items from Sharepoint list to pick email address to use for the variable varTo (I don’t use varCC). For this to work, I had to put varTo in an Apply to each, but that’s ok and worked fine.

    The thing is, that when multiple items (=more than one) are collected from the Get items, the flow uses only the first “To” address for every email. The correct number of emails are sent, but the varFullSubject is identical in every email (meaning that in the second Flow in the tutorial, every email is being forwarded to the same recipient). So you need to put all the variables into an Apply to each, thus creating one varTo per list item (=one To address per list email address). This works fine – the Flow creates one varTo per list item.

    But then, I have had a hard time putting the different varFullSubjects into the emails. The issue I ran across is, that an Apply to each that contains variables must be set to Concurrency control=1, meaning that the Flow stops and waits for the options email to be answered by the recicient before the Flow moves on to send the next email.
    To avoid this, I put the options email inside a new Apply to each, with Concurrency control set to maximum (50). This in turn does send all the emails at once, but again – only to the first “To” address in the varFullSubject …. and there I’m stuck.

    Do you have an idea for this?


    • @Marten,

      Is it helping when you’re update the ‘varTo’ after every mail your send to: null (use expression) ?

      In that case you’re be able to use the new values for the correct items.

      • @Dennis Thanks for the reply,
        I tried that, but din’t really understand it 🙂 so instead, I changed the trigger of the flow to “when an item is modified” with trigger conditions, so the flow runs once for every item, so there is no need for the Get items action.

        The flow is trigged by another flow, that runs on a schedule and then updates a column value.

  4. I did what you instructed above. My flow will not send the second email until the Options email has been actioned. (someone pressed a button) How can I by-pass this?

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Latest articles

%d bloggers like this: