Power Automate Approval - Update Item Depending on Approval Responder

32 Views Asked by At

I am trying to create a flow on Power Automate to approve recruitment forms. The hiring manager submits a Microsoft Form, which triggers the flow. The hiring manager's line manager receives an approval; if they approve, a new approval is triggered, which goes to HR. Once HR approves, a new approval is triggered, which should go to the corresponding director. The form has a field for the director's name, allowing the approval to go to the correct person. However, after each approval, a list item on SharePoint is uploaded with the approval date. The form could go to one of three directors.

I want to update the fields in SharePoint (Director 1 approval date, Director 2 approval date, and Director 3 approval date) depending on which person the approval went to. I can't do multiple conditions because of the maximum nesting rule.

I have been trying to add an IF statement to each update field (if the director name on the form is 'Director 1 Name' then add the approval completion date, else leave blank) This is what I have so far:

if(body('Create_item')?['Director']='Director 1 Name', body('Create_item')? ['Director1ApprovalDate']=body('Start_and_wait_for_an_approval')?['completionDate'],body('Create_item')?['Director1Date']=empty)
0

There are 0 best solutions below