cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AKB_2K Helper I
Helper I

Get approver name from Start and wait for an approval (V2)

Hello,

 

I have created a flow to get approval from a "single" manager whenever new item is added to SharePoint list. 

I want to capture and store following information back to SharePoint list after the approver responds.

 

  • Approver name
  • Request sent date
  • Request approved date
  • Response
  • Comments

To achieve this I used Start and wait for an approval (V2). But I when I tried to update the approval information back to SharePoint list, on adding Approver name value in corresponding column value, FLOW is creating a loop. When I looked closely at the JSON, seems the approver name comes as part of a array and may be that is the reason  flow is creating a Apply to each loop automatically. JSON response is something like this.

  "responder": {
    "id": "02-----------------------------------",
    "displayName": "lastname, firstname",
    "email": "firstname.lastname@email.com",
    "tenantId": "e2b--------------------------------------",
    "userPrincipalName": "firstname.lastname@email.com"
  },
  "requestDate": "2019-06-12T17:15:56Z",
  "responseDate": "2019-06-12T17:16:50Z",
  "approverResponse": "Approved",
  "comments": "Test approver"
}

I wrote following JSON to get the Approver comments:

{
  "type": "object",
  "properties": {
    "comments": {
      "type": "string"
    }
  }
}

But dont know how to pull the approver displayName details. Can someone help?

 

Regards,

AK

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Get approver name from Start and wait for an approval (V2)

Hi @AKB_2K ,

 

Apply to each will appear automatically because Responses is an array, and Approval information you want to get is properties in this array element.

You could completely ignore Apply to each. If Approval type is First to respond, Apply to each will not affect the result.

Image reference:

8.PNG

Please take a try.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Highlighted
Community Support
Community Support

Re: Get approver name from Start and wait for an approval (V2)

Hi @AKB_2K ,

 

Apply to each will appear automatically because Responses is an array, and Approval information you want to get is properties in this array element.

You could completely ignore Apply to each. If Approval type is First to respond, Apply to each will not affect the result.

Image reference:

8.PNG

Please take a try.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

AKB_2K Helper I
Helper I

Re: Get approver name from Start and wait for an approval (V2)

Thanks for the info @v-bacao-msft. I will try it out today and post my findings.

 

If possible can you let me know if this same logic can be applied to email template too? Because after updating the sharepoint list, flow will have to send email to Requestor mentioning the "Approver name" along with datetimestamp of when it was approved/rejected.

 

Cheers!

AK

Community Support
Community Support

Re: Get approver name from Start and wait for an approval (V2)

Hi @AKB_2K ,

 

Thank for your reply!

 

You could try to configure Response summary in Body, which contains the "Approver name" along with datetimestamp of when it was approved/rejected.

36.PNG

You could also add some item information to identify the request.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (6,867)