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

Using the Approval Flow to send to an alternate approver

Hi guys, 

I have a powerapps form which basically functions as follows:

 

  1. Form submitted via PowerApps >
  2. SharePoint list updates >
  3. Another user then checks the form details within PowerApps and selects submit (to kick start an approval process)
  4. Flow kicks in and sends an approval to the 'Manager Email' (picked up from the Office 365 Users connector). 

I have a requirement to set an alternate approver. And as such I have another text field called 'Alternative 1st Approver'. 

My thought train is that at stage 3 above, the person checking the form could enter the email address of an alternative user. 

 

What I'm looking for, is for Flow (specifically the approval element) to have the ability to carry out a check as follows:

 

  • If SharePoint list item 'Alternative 1st Approver' contains an email address send the approval to it
  • If it is blank, send the approval to the 'Manager Email' (picked up from the Office 365 Users connector)

 

Flow.JPG

 

Does anyone know if this is possible or a means to achieve this?

 

Thanks,

Tricky

 

1 ACCEPTED SOLUTION

Accepted Solutions
ScottShearer
Super User III
Super User III

@Tricky778 

I agree with @Pstork1 but would like to suggest that this could also be done with a coalesce expression and no condition.  The coalesce expression will return the first non-null value

In my example, I have a column called Alternate Approver.  My coalesce expression looks like this:

coalesce(triggerBody()?['Alternate_x0020_Approver']?['Email'],body('Get_manager_(V2)')?['mail'])

 

 

Coalesce1.jpg
 
 
 
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

View solution in original post

4 REPLIES 4
Pstork1
Dual Super User III
Dual Super User III

Yes, Its very possible.  I would do it this way.

 

  1. Create a string variable to hold the approver's email.
  2. Get the manager's email and add that to the variable.
  3. Use a condition to check whether the alternative approver field is empty or not.  If not, set the approver variable to that email address.
  4. Send your approval normally, but use the variable for the assigned to field.


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
ScottShearer
Super User III
Super User III

@Tricky778 

I agree with @Pstork1 but would like to suggest that this could also be done with a coalesce expression and no condition.  The coalesce expression will return the first non-null value

In my example, I have a column called Alternate Approver.  My coalesce expression looks like this:

coalesce(triggerBody()?['Alternate_x0020_Approver']?['Email'],body('Get_manager_(V2)')?['mail'])

 

 

Coalesce1.jpg
 
 
 
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

View solution in original post

Pstork1
Dual Super User III
Dual Super User III

I hadn't thought of that approach.  Its a good solution.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Thanks for the suggestions @Pstork1  @ScottShearer , coalesce expression proved to do the job 👍

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Users online (13,189)