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

Exclude an Approver if they are the Submitter (Requester)

Hi, 

 

Please note that I have a flow that has 4 approvers and usually one of them is requesting the form for approvers.  I want to exclude the requester from approving this form since his approval is inherited and no need to approver from his side.

 

I need this to be dynamically done. 

 

I am using "when the item is created", "initializing variables, then it will go for approvers "start and wait for approval (all must approve)".  I think the step of excluding the approver should come before the start and wait for approval (all must approve). 

 

I appreciate your help with this issue. 

 

Thanks. 

 

Waleed. 

1 ACCEPTED SOLUTION

Accepted Solutions

Thanks Scott. 

 

It is working now, I re-arranged the emails!!

 

Once again thanks for your support.

 

Waleed

View solution in original post

17 REPLIES 17
Super User III
Super User III

@WK-PA2020 

Please see my screen shots below.   I populate an array with the names of all approvers.  Then I loop through the array and compare the created by email to the array element.  Please note that Flow is case sensitive - be sure the enter the email addresses with that in mind or your condition won't work properly.

image.png

image.png

image.png

 

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

Scott

Hi Scott, 

 

Shall I include all the emails in the initialize variable (all approvers) in the value place?

 

Please note that I already have an Initialize variable to get all responses!  (after when item is created).  Is this affecting your steps?

 

Thanks. 

 

@WK-PA2020 

All approvers should be included in the array.  My loop adds approvers to the string variable only if they are not the creator of the item.

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

Scott

Hi Scott, 

 

I put the emails in the value as: 

"wwwww@nnnnnnn.com",

"kkkkkkk@nnnnnnn.com"

 

I received the below message and the flow failed:

 

The variable 'VarApprovers' of type 'Array' cannot be initialized or updated with value '"         @           com"
" @     .com"' of type 'String'. The variable 'VarApprovers' only supports values of types 'Array'.

 

Thanks. 

 

Waleed

May I should include: 

 

]

 

[

 

 

Hi Scott, 

 

I put 3 emails and one of them to the requester but it failed and gave the below message, but before a few minutes I tried 2 emails one of them for me and it is succeeded!

 

The variable 'VarApprovers' of type 'Array' cannot be initialized or updated with value '[
"         @      .com",
"         @              .com",
"         @    .com",
]' of type 'String'. The variable 'VarApprovers' only supports values of types 'Array'.

 

Thanks, 

 

Waleed

@WK-PA2020 

I believe that removing the last comma in your array will resolve your issue.  The comma separates elements of the array and should not be included after the last element.

 

 

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

Scott

I amended the emails and removed ( , ) from the last email in the end and now it gives me the below message: 

 

"There's an error in your flow preventing the creation of Approvals. Use the link below to learn more about the errors with your flow and/or environment configuration."

 

And in the Start and wait for approval is giving the below message: 

BadRequest. The request failed. Error code: 'InvalidApprovalCreateRequestAssignedToNoValidUsers'. Error Message: 'Required field 'assignedTo' contained no valid users in the organization'.

 

Thanks.

Hi Scott, 

 

When I remove the 3rd email it is working and the fill as follows: 

 

[
"            @       .com",
"            @       .com
]

I removed the comma (,) and now giving me another message:

 

There's an error in your flow preventing the creation of Approvals. Use the link below to learn more about the errors with your flow and/or environment configuration.

 

And in the Start and wait for approval is giving the below message: 

BadRequest. The request failed. Error code: 'InvalidApprovalCreateRequestAssignedToNoValidUsers'. Error Message: 'Required field 'assignedTo' contained no valid users in the organization'.

 

Thanks. 

@WK-PA2020 

It sounds as though none of the approvers were added to your string.  Take a look at your run to verify.  Refer to my example above which works.

 

 

 

 

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

Scott

Hi Scott, 

 

This is the solution as per PA but still, I cannot determine the solution. 

 

Thanks.  

Thanks Scott. 

 

It is working now, I re-arranged the emails!!

 

Once again thanks for your support.

 

Waleed

View solution in original post

Hi Scott, 

 

Is it ok to put 3 emails or more in the initialize Variables?  Actually I am doing 3 emails but it is giving the same message and error that the emails not found but when I try 2 of them it is working!!

 

Thanks. 

@WK-PA2020 

You can add as many approvers as you would like.  Please post an updated screen shot of your Flow if you need help.

 

 

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

Scott

Hi Scott, 

 

I have 2 approvers in addition to me, for 3 of us it is not working and I am the requester!  In case I put my self and one of them it is working and correctly ignoring me as I am the requester and that means the error that the user is invalid and not found in the organization is wrong. 

 

I rearranged the emails in initialize Variables but without no hope but earlier it succeeded!

 

Really I do not know what is the problem. 

 

Thanks, 

Hi, 

 

Any help on this issue? 

 

Thanks, 

 

Waleed

Helpful resources

Announcements
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Microsoft Ignite

Microsoft Power Platform: 2021 Release Wave 1 Plan

Power Platform release plan for the 2021 release wave 1 describes all new features releasing from April through September 2021.

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (102,754)