cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RaymondNPZ1
Regular Visitor

Input the first approval response to another approval details

Hi,

 

I will like to know how to set when 1st approval approved and response in approval text box.

This response from 1st approval will map to the email approval under details to the 2nd approval

 

Thanks

1 REPLY 1
poweractivate
Super User
Super User

@RaymondNPZ1 

 

Flow waits on the Flow run on each "Start and wait for an Approval" Action - the Flow run is not stopped, and it is waiting there on the Action block in the Flow Run until that Action is resolved (i.e. until Approved or Rejected)*. So you can simply add the steps you want it (even possibly another "Start and wait for an Approval" action)  below it and just simply use the Approval Response directly in the same Flow as a Dynamic Content. 

 

For example if you want the e-mail address of the person who approved it, just add a step below the "Start and wait for an Approval" Action block, and then for the field you want to populate, select from Dynamic Content -> "Responses Approver email" under "Start and wait for an approval" - like below:

 

82221-inpt-01.png

 

 

Notice that it automatically wraps an Apply to Each. That is because there could be more than one response.

Even if I selected "First to Respond" - Power Automate presumes there could be more than one response:

82221-inpt-02.png

 

You have two choices

 

1. Initialize a Variable at the top, and Inside the Apply to Each, Set that Variable with the "Responses Approver email" If there is only one response, this will work - then use the Variable as Dynamic Content on later steps after the Apply to Each

 

2. If you are absolutely sure you want only the very first response and do not care if there are any others (for example - if you say "First to respond" - there will always be only one response anyway, even if Power Automate forces the Apply to Each on there, it will always be one iteration in that case) - then instead the Instead of Apply to Each, just use a custom expression to get the first item of the Responses Action, and then get the equivalent of "Responses Approver email" as an expression, like this:

 

outputs('Start_and_wait_for_an_approval')?['body/responses']?[0]?['responder/email']

The above is an example.  Make sure to use the name of your Approval action which may be something else other than 'Start_and_wait_for_an_approval' (the rest can stay the same). If you want something other than "Responses Approver email"  you would put something other than "responder/email" there.

 

 

82221-inpt-03.png

 

The above Compose example is not in an Apply to Each - in fact, it is instead of it when you are sure you want a specific field of the first response only.

 

If you prefer, you can use a Compose to get the first item and store it for temporary use:

 

Suppose a Compose Action block named Whatever_compose whose Inputs has an Expression like this:

outputs('Start_and_wait_for_an_approval')?['body/responses']?[0]

(the above will keep in mind the first element of "Responses")

 

and then you could use that as a basis to get the Response fields you want in later Action steps, like this:

 

outputs('Whatever_compose')?['responder/email']

 

Where 'Whatever_compose" above is the name of the Compose action containing just the first item itself above. 

 

*Note: Note that a Flow Run terminates if it is still running for longer than 30 days - just keep it in mind. There are ways to work with this but I won't go into them for now for simplicity.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Users online (1,833)