I have created a workflow that will trigger an approval/reject email to be sent when a new item is created in a sharepoint list. What i need to add to this flow is the ability to email a person based on variables.
I want the person emailed to be the manager of the "employee name" that is in the new row created on the list. Can anyone help me with how to accomplish this? Below is a screenshot of current flow.
Sure. Based on your screenshot it would look like this. 'Search for users' dynamic content would be your 'employee name'. Even if it only returns one user, it will be an array. For the 'Get manager' I use the 'First' expression to get the first email address in the 'Search for users' array:
Got it! Could you send me a screen shot of what the branching for that would look like?
Ah. There is another action called 'Search for users (V2)' that you could put the name in to find their email, then their manager with that action. This would be prone to errors though, like multiple employees with the same display names or the name being spelled incorrectly in the form. These would result in either multiple users returned from the search or none. I would recommend trying to go back to making it a person field to not need to worry about those things.
It’s not a person column. I have a power app form that gets filled out and pushes to this list, and I couldn’t get the column as a person to populate correctly so I changed it to just text.
is there another way to accomplish this?
Is the 'employee name' a person column? If so you can use the dynamic content to get that person's email address and use it in the 'Get manager (V2)' action. Then assign the approval to the email from the get manager dynamic content.
Michael E. Gernaey
566
Super User 2025 Season 1
David_MA
516
Super User 2025 Season 1
stampcoin
492