web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / I'm trying to build a ...
Power Automate
Answered

I'm trying to build a Dynamic Approval flow using two different Sharepoint lists. one will contain the approvers and the other will contain the form.

(0) ShareShare
ReportReport
Posted on by
 

Hello All, 

 

I'm trying to build a Dynamic Approval flow, using two different Sharepoint lists. one will contain the approvers and the other will contain the form.
 
 My flow filter in Get items has 3 filters" (Department eq 'DEPARTMENT VALUE') and (Country eq 'COUNTRY VALUE') and (RiskLevel eq 'RISK LEVEL VALUE') ".
 
When i test the flow, the slow doesnt get inside the "Apply to each" action and gives an error at "Start and wait for approval"(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.)
 
I'm unsure what I'm doing wrong. (I'm trying Build an approval flow based on 3 filters criteria, The approval goes to a person based on what country, Department and Risk level the user chooses)
 
Screenshots of the flow for your reference:
1)
Tenred_2-1712409698069.png

 

2)
Tenred_3-1712409840539.png

 

3) Tenred_4-1712409879011.png

 

 
Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    68,717 Most Valuable Professional on at

    Since the Apply to each never runs it appears there is a problem with the OData query in your Get items over filtering your list.  I suspect you aren't getting any records. Since the output of Get items is a null array the Apply to each is skipped. That means your variable for the Approval action is null and that leads to the error. ou need to revisit the Get items filter and fix that to get your approvers.  

     

    I also notice in the Apply to each that you aren't adding a semicolon between the email addresses and are using a set variable. You should probably use an append to variable instead. Otherwise each loop of the apply to each will overwrite the last setting.

  • Tenred Profile Picture
    on at

    Hello @Pstork1 , 

     

    Thanks for your reply.  I also believe the issue lies in the OData query. 

     

    Can you check if my method in order to get the Approvers is correct?

     

    Here are the 2 SL I'm using(including screenshot). 

     

    1) I've created a 3 choice columns for the user to select the Risk level and country and department. and then converted them to Lookup columns as "Risk Lookup" & "Country Lookup" & "Department Lookup"

     

    Tenred_0-1712411549716.png

    2) I've created the second SL to holds 3 lookup columns, the CountryLookup, RiskLevelLookup and DepartmentLookup and lastly the column that contains the Approver names. 

     

    Tenred_1-1712411834820.png

     

    -------------

     

    And here is my get item filter query:

     

    Tenred_2-1712412203995.png

    -----------------------

    I believe I'm going wrong here, Can you advise? Is the method I'm using correct? 

  • Pstork1 Profile Picture
    68,717 Most Valuable Professional on at

    Can you show me the SharePoint Column settings for the two lists? Are you using actual Lookup columns in the second list?  OData queries only work on the primary lookup field in a lookup column.  The additional values are available but can't be used to filter or retrieve the specific records.

  • Tenred Profile Picture
    on at

    Here's the first list I'm using :

     

    Tenred_0-1712413823095.png

     

    The second lists column setting for each column(4 in total):

    1. Tenred_1-1712413918731.png
    2. Tenred_2-1712413948062.pngTenred_3-1712413963394.png
    3.  
    4. Tenred_4-1712413989113.png

       

     

  • Pstork1 Profile Picture
    68,717 Most Valuable Professional on at

    Let me try some things. But I think the problem is the way the second list is built. I don't think you are going to be able to do an OData query using those three lookup columns to get a single record from the first list.

  • Tenred Profile Picture
    on at

    Thank you @Pstork1 . 

     

    Do you think such a Flow is possible?

     

    We're trying to get an Approver's Email. Based on what the Risk Level(red & amber), Department(5 Departments) and country(192 😥) the user chooses, and we send it to them for approvals. 

     

    The Problem I'm facing is extracting the Approver Email from the Approval matrix(sharepoint list).

  • Verified answer
    Pstork1 Profile Picture
    68,717 Most Valuable Professional on at

    Its definitely possible, but the second list that the approver comes from shouldn't be using Lookups for the values that you are filtering on.  If you replace those with either choice columns (for the risk level since its relatively limited) or text fields for the department and country it should work fine.  The problem is that filtering by lookups is very limited, particularly a list that has 3 lookup columns to the same list.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard