Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested answer

Quote Approval Flow with two approving persons

(0) ShareShare
ReportReport
Posted on by 17

Hi experts, 

I am stuck builing a Approval Flow. I alread successfuly built one for ONE approving person, but I need one now for two approvers. 

When the flow is started (manually), there are e-mails sent out to the two chosen approvers. When they approve, I want to have the name of approving user 1 in field "approval 1" and the name of approving user 2 in field "approval 2" in the quote.

And this is exactly where I am stuck... Could anyone help me?? 

pastedimage1623746726537v3.png

pastedimage1623746661193v2.png

Thank you so much in advance! 

  • Community Member Profile Picture
    on at
    RE: Quote Approval Flow with two approving persons

    Good answer

  • yvka123 Profile Picture
    17 on at
    RE: Quote Approval Flow with two approving persons

    Yay it works!!

    THANK YOU SO MUCH for guiding me through!

    I would have never managed this by myself! You saved my day :-)

  • Charan Raju C R Profile Picture
    7 Moderator on at
    RE: Quote Approval Flow with two approving persons

    Here you go.

    1805.Flow4.png

  • yvka123 Profile Picture
    17 on at
    RE: Quote Approval Flow with two approving persons

    Okay thank you again I will try it. One maybe a bit of a stupid question, but what kind of connector is this??

    pastedimage1623830344199v1.png

    Update: I found it but don't know how or where to insert the code that you put next to the steps... The default expressions given don't seem to match the ones you chose

  • Suggested answer
    Charan Raju C R Profile Picture
    7 Moderator on at
    RE: Quote Approval Flow with two approving persons

    Hi,

    My previous solution was to set the approver names in string fields.

    Since there are more than one approver, we need to segregate the approver Ids from the array of response. That's the reason it is little complicated compare to single approver. I have tried below approach and it is perfectly working fine.

     

    ApprovalFlow.png

    1. Body: Inputs field set to body of approval action: outputs('Start_and_wait_for_an_approval')?['body']

    2. AllResponses: Inputs field set to dynamic expression: outputs('Body')?['responses']

    3. FirstResponse: Inputs field set to dynamic expression: outputs('AllResponses')[0]?['responder']

    4. SecondResponse: Inputs field set to dynamic expression: outputs('AllResponses')[1]?['responder']

    5. FirstApproverAADId: Inputs field set to dynamic expression: outputs('FirstResponse')?['id']

    6. SecondApproverAADId: Inputs field set to dynamic expression: outputs('SecondResponse')?['id']

     

    Responder id received from the approval body is not system user id, that is Azure Active Directory Object Id. So, we need to retrieve system user record using this id and store systemuserid in FirstApproverGUID and SecondApproverGUID compose action to use them for record update.

    7. List rows - First Approver: Select columns set to systemuserid, Filter rows set to azureactivedirectoryobjectid eq outputs('FirstApproverAADId'), Row Count set to 1

    GetFirstApprover.PNG

    8. FirstApproverGUID: Inputs set to systemuserid of first user record in the second approver users list first(outputs('List_rows_-_First_Approver')?['body']['value'])['systemuserid'] 

    9. List rows - Second Approver: Filter rows set to azureactivedirectoryobjectid eq outputs('SecondApproverAADId')

    10. SecondApproverGUID: Inputs set to systemuserid of first user record in the second approver users list first(outputs('List_rows_-_Second_Approver')?['body']['value'])['systemuserid'] 

    11. Update a row: set Signature 1 and Signature 2 to /systemusers(outputs('FirstApproverGUID')) and /systemusers(outputs('SecondApproverGUID')) respectivlely

  • yvka123 Profile Picture
    17 on at
    RE: Quote Approval Flow with two approving persons

    So I managed now to differenciate between the two Approvers and also got the first Approver in my Signature 1 field. The flow is now executing but for some reason the last step which should put my Approver 2 in Signature 2 field of the quote is not executing but there is no error? It just simply doesn't execute? 

    Any ideas whats going on here?? 

    pastedimage1623825700995v1.png

  • yvka123 Profile Picture
    17 on at
    RE: Quote Approval Flow with two approving persons

    Thank you for your effort but unfortunately I am already stuck with the "Responsers approver name" The "signature" fields are lookups to system users and it doesn't match the "responsers name" because first and last name is switched there....

    Is there no simpler way to handle this? It is so easy if it's only one approver, how can it be that complicated for two?

    Worst case would be that you'll manually have two flows for each approver but that is anything but convenient :/

  • Suggested answer
    Charan Raju C R Profile Picture
    7 Moderator on at
    RE: Quote Approval Flow with two approving persons

    Hi yvk123,

    I guess you're using 'Approve/Reject - Everyone must approve' approval type. So, you are trying to capture names of both approvers parallelly.

    Create below six compose actions inside 'If yes' condition branch to get the first and second approver names.

    1. Body: Inputs field set to body of approval action

    2. AllResponses: Inputs field set to dynamic expression: outputs('Body')?['responses']

    3. FirstResponse: Inputs field set to dynamic expression: outputs('AllResponses')[0]?['responder']

    4. SecondResponse: Inputs field set to dynamic expression: outputs('AllResponses')[1]?['responder']

    5. FirstApproverName: Inputs field set to dynamic expression: outputs('FirstResponse')?['displayName']

    6. SecondApproverName: Inputs field set to dynamic expression: outputs('SecondResponse')?['displayName']

    Then add 'Update a row' action and map Outputs of FirstApproverName to Signature 1 field and SecondApproverName to Signature 2 field of Quote record.

    2110.Flow3.png

    If you encounter any issue where 1st approver appearing as 2nd approver, you may need to sort the response. Refer to below link to build sort function.
    https://sharepains.com/2019/07/13/sort-an-array-power-automate/

  • yvka123 Profile Picture
    17 on at
    RE: Quote Approval Flow with two approving persons

    Hi Charan,

    thank you for your replay! But how can I define which Approver should be in which field? I would like to have Approver 1's name in Signature 1 field and Approver 2's name in Signature 2 field - is there a way?

    Thank you!

  • Suggested answer
    Charan Raju C R Profile Picture
    7 Moderator on at
    RE: Quote Approval Flow with two approving persons

    Hi yvka123,

    Please follow below steps to capture the approver name on Quote record.

    1. Under approval action 'If yes', add 'Update a row' Microsoft Dataverse action

    2. Select Quotes for Table Name and Quote (Unique identified) for Row ID

    3. Click 'Show advanced options' to see all the fields related to Quote

    4. Click inside 'Approver 1' or 'Approver 2' textbox and select 'Response Approver name' from dynamic content list


    Approval Flow

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,884 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,758 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans