
Announcements
I started with a basic approval flow and found that I wanted to send an email to different managers based on whether or not the user had put in a certain item type.
The way I had the condition set up was so that if it came up YES then one manager would be emailed for approval. If NO a different manager would be sent an approval request. After that another condition was set looking to YES if the manager clicked Approve otherwise default to NO. This worked just fine
Soon I realized the manager that was emailed in the NO part of the condition was always defaulting to false, regardless of whether or not they clicked approve. I looked at the condition after the emails were sent and found that the way the SelectedOption condition was set only one email was actually being looked at when determining yes or no. Here is how it was set by default:
@equals(body('EMAIL_FIRST_MANAGER')?['SelectedOption'], 'Approve'
I went in and put together my own condition using @or to look at both emails but that is not working. Here is the syntax I used:
@or(equals(body('EMAIL_FIRST_MANAGER')?['SelectedOption'], 'Approve'), equals(body('Email_OTHER_MANAGER')?['SelectedOption'], 'Approve'))
Using this breaks the flow. With the above condition in place the flow does not even start. I am wondering if this is just not supported using a SelectedOption condition when you have two separate emails being generated by a previous condition.
Hi 1800Tyson,
May you consider to use Switch case in your flow.
Details about Switch case:
https://flow.microsoft.com/en-us/blog/search-by-service/
If the item type is equal to Yes, send approval email to one manager, if the item type is equal to No, send approval email to another manager.
Then add conditions under each case, if the SelectedOption is equal to Approve, do an action, if not, do another action.
Please try if this will work for you.
Best regards,
Mabel Mao