cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

If Statement for Assign To

Hello,

I'm brand new to this so forgive me please for not understanding something that is probably very simple. I have built a flow to request approval for vacation time. In the Assign to: field I want add an If statement for who it is assigned to based on who has sent it in. All Staff approvals will be assigned to the line manager, but the line managers approval will have to go to the general manager.

 

I have the statement like this:

if(triggerBody()?['Author']equals'John Doe','user@email.com, 'otheruser@email.com')
 
Just a note, If I don't use an if statement and just assign it to people automatically my flow works perfectly. It's just to narrow this down so the higher level manager only gets requests from one person rather than all staff.
The Author field it is noting in the statement is when I select the Created By field in the Dynamic Content.
 
Thank you in advance for any help you can give me.
5 REPLIES 5
Highlighted
Super User III
Super User III

Re: If Statement for Assign To

@Nunzie you could do something like this in your flow.

1. When the request arrive, get the response details (if you are using Microsoft Forms for the request).

2. Add an Office 365 Users Get Manager (V2) action and select Responder's Email from the dynamic content. That will get the manager of the person who submited the request.

3. Add a Start and wait for an approval and in the Assigned to field select Mail from the Get Manager (V2) section of the dynamic content.

0 trigger-approval.png

Add a condition of Outcome is equal to Approve.

In the If yes channel add another Get Manager (V2) action but this time select Mail from the first Get Manager (V2) action. That will get the manager's manager and you can then send an email to them with the details of the approval.

1-condition-getManager.png

Rob
Los Gallardos
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks. 

Highlighted
Helper II
Helper II

Re: If Statement for Assign To

Hi,

I had my flow working slightly different, but if I change it to this way, can I ask where the Get Manager action is actually getting the managers email from just based on the request?

Highlighted
Super User III
Super User III

Re: If Statement for Assign To

For the initial approval the Get Manager (V2) is getting the manager's email from Responder's Email which you select in dynamic content (see the third action in my first screenshot above). The supervisor's email is got from the first Manager's Mail.

Rob
Los Gallardos

Highlighted
Helper II
Helper II

Re: If Statement for Assign To

Thanks for your reply. I saw your screenshots, but it's sort of missing the point of what I am trying to do, or I am misunderstanding you. If so, apologies.

 

But users aren't using a form to make the request, they can either go directly to the list itself, or use a power app. My question still remains though, in the get response details step and the get manager step, I don't know how it knows the managers email to get it based on the form completion. Where does it pull that from?

 

I just thought it would be simple to put an IF statement in the Assign to field as if they are from one specific person Manager A responds otherwise Manager B will respond to all others. Basing it on the requester name. SS.png

Highlighted
Helper II
Helper II

Re: If Statement for Assign To

I've managed to get the If statement to work as I was hoping. I just had the EQUALS part incorrect initially.

 

Thanks for the advice and tip!

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Users online (5,700)