cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Julien2
Post Prodigy
Post Prodigy

Multiple approvals based on different columns

Hello everyone,

I have a SharePoint list that contains data of the requestor approval as below:

ApprovalExample.PNG
I want to create a flow that will send approvals for the desired users based on the above data.
As you can see, I have 4 approval levels but for records 1 and 2 some approvals columns are blank and don't have an approver user assigned.

The flow should always have 4 approvals actions but in case one of the approval level columns is blank it should skip that level (to avoid any flow failure) and check for the other approver column, if it is not blank it will send the approval to the defined user.

Please find below what I tried as testing before I link my flow to the original list:
Flow1.PNGFlow2.PNG

I have used an array variable to avoid defining 4 variables for each approval column and I used the expression below to extract the element from the array:
for example: variables('TestingFlow)[0] - will be for the first approval column and so on..
Do you think it is a good practice based on what I have tried or there is/are other simple and easier ways?

Note: I cannot change the SP list structure and assign the approval under one column it is required to follow this structure.

Kindly advise if I should proceed with the flow that I tried.

Any help is highly appreciated.

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
Pstork1
Dual Super User III
Dual Super User III

If you need to get the list of approvers from 2 different lists then yes, I would use a variable.  But I wouldn't go to the trouble of using an array.  Since both lists have 4 columns just set the each of 4 variables equal to one of the columns and then use the same setup I provided, just using the variables instead of the actual fields.



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

View solution in original post

6 REPLIES 6
Pstork1
Dual Super User III
Dual Super User III

Do you want the approvals to go out in parallel or serial (one after the other).  Could it be done with one approval set for All must approve?  If one approval with all must approve as a possibility I would just use the fields as they are and wrap each one in a Coalesce() so if they are null they will be replaced by a space in the list.

concat(Coalesce(<<1stApproval>>,' '),';',Coalesce(<<2ndApproval>>,' '),';'.....)

That would lead to a semicolon delimited string where the spaces will be ignored when sending the approvals



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

Hello @Pstork1 ,

Thank you for your reply and for providing an example.

The scenario that I have for approvals should go out one after the other and the approval type will be the first to respond.

According to your example, it is all must approve within the same approval action.
What will be logic if it is "First to respond" with 4 different approval actions and each approver user in the SP list stored in a column that might be blank? (I have 4 approval levels)

I look forward to your response.

Best regards,

Pstork1
Dual Super User III
Dual Super User III

To send them one after another just stack the 4 approvals up in the workflow and have a condition check for the empty user before sending the approval.  Something like this

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.

Hi @Pstork1 ,

The reason why I cannot use the length function is that I have two different approvals lists and the flow will query one of them based on the request type.

So If I hardcoded for example XX field is eq to null from list 1 and the get items query as a result return data from list 2 the flow will fail.

That's why I considered using variable and filling it with the approval details regardless if it is from list 1 or 2 separated with ; for each column and in that case I check for each index in the array since I know how many approvals do I have for that form and If an index is blank proceed to another approval level.
Flowwithoutresult.PNGfLOWrESULTApproval.PNG

In that case, the above testing example that I provided is a good practice, or do you have any other ideas?

I thought about splitting the flows into two and each flow based on the type I am checking on it will trigger so it will be straightforward.

I look forward to your response.

Pstork1
Dual Super User III
Dual Super User III

If you need to get the list of approvers from 2 different lists then yes, I would use a variable.  But I wouldn't go to the trouble of using an array.  Since both lists have 4 columns just set the each of 4 variables equal to one of the columns and then use the same setup I provided, just using the variables instead of the actual fields.



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

View solution in original post

Julien2
Post Prodigy
Post Prodigy

Hi @Pstork1 ,

One of the lists has 3 columns and the other 5 columns, so in total, I will need 5 different variables.
I will follow the logic that you mentioned to check for each variable if it is blank.
I have used an array variable to avoid initializing 5 variables.

Thank you!

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

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

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,736)