Skip to main content

Notifications

Community site session details

Community site session details

Session Id : jYe5wPywklHrg5KA3O0bD6
Power Automate - Building Flows
Answered

Fitler array - multiple conditions

Like (2) ShareShare
ReportReport
Posted on 23 May 2019 04:24:03 by 45

I need some help with a filter on a spreadsheet. This follows a 'list rows present in a table' action. The goal of the flow is to update or create items in a sharepoint list. 

 

One of the columns is called project phase. I want to filter out all projects where the phase is either empty or closed. 

 

I currently have this set up using two conditions inside an apply to each action. However, this is very slow and the flow takes over 1 hr to complete. 

 

I know I can use the filter array to do this, but how do I set it up to test for both empty and closed items? And how do I tie this in with the updating/creating of a sharepoint item? 

 

 

  • Community Power Platform Member Profile Picture
    on 26 Aug 2021 at 04:45:50
    Re: Fitler array - multiple conditions

    It does not take more than one condition in filter array advanced mode. Has this feature been deprecated ? 

    Speaking as of August, 2021.

  • Community Power Platform Member Profile Picture
    on 28 Jul 2021 at 11:28:19
    Re: Fitler array - multiple conditions

    How to handle the case when no row matches a criteria ? It throws me an error saying that row with ID "xx" not found even after I have specified a child process which is configured to run only if the parent fails to run.

  • Community Power Platform Member Profile Picture
    on 28 Jul 2021 at 11:26:20
    Re: Fitler array - multiple conditions

    can we also use StartsWith with the column name from a excel sheet while using filter array ? If yes, how do we write it ?

  • Digitize Profile Picture
    11 on 05 Nov 2020 at 21:20:31
    Re: Fitler array - multiple conditions

    Hi @Brad_Groux,

     

    My flow to add feedback to excel rows, based on matching to the first column 'Message ID' is to slow to use, I think your above solution may help but I am not sure - please take alook:

     

    https://powerusers.microsoft.com/t5/Building-Flows/Conditions-to-update-correct-excel-row-based-on-matching-to/m-p/736001#M100874

     

  • Benabbas Profile Picture
    6 on 31 Oct 2020 at 13:36:00
    Re: Fitler array - multiple conditions

    You can simply overlay filters array

     

    The first condition is a normal filter array

     

    The second filter array should take the body from the first filter array, the condition item should be item()?['Date']

     
    and so on
     
    Never put filter array inside an apply to each to avoid looping
     
     
     
     

     

     

  • hebbo7 Profile Picture
    2 on 18 Jun 2020 at 05:17:14
    Re: Fitler array - multiple conditions
    Hi, I was trying to filter multiple conditions in flow (validating forms response with SP list) for my desk booking flow; 1) Date & Desk No exist in SP 2) Date & Employee name exist in SP its working for validate the date & desk no but 2nd validation didn't worked
  • RobinV86 Profile Picture
    45 on 30 May 2019 at 00:18:03
    Re: Fitler array - multiple conditions
    "error": { "code": 502, "source": "australia-001.azure-apim.net", "clientRequestId": "5338bd9d-2683-4126-a87c-3081d3a95fa7", "message": "BadGateway", "innerError": { "status": 502, "message": "Graph API is currently unavailable.\r\nclientRequestId: 5338bd9d-2683-4126-a87c-3081d3a95fa7", "source": "excelonline-ase.azconn-ase.p.azurewebsites.net" } } }

     

    I'm going with the filter 🙂

    I'm trying to implement it now. Wouldn't your solution accomplish the opposite of what I am trying to accomplish? I'm trying to go ahead with a list that does not contain empties and closed projects. Either way, I've changed it to the 'contains t'  and that works! 

     

    I managed to get the odata filter working in a sense; it now throws a 502 error though. 

    {
                          
  • v-bacao-msft Profile Picture
    on 24 May 2019 at 05:56:20
    Re: Fitler array - multiple conditions

    Hi @RobinV86 ,

     

    Have you tried the method I provided?

    Please let me know if you have any question.

     

    Best Regards,

  • RobinV86 Profile Picture
    45 on 24 May 2019 at 02:33:39
    Re: Fitler array - multiple conditions

    I've tried the filter query solution first but I am getting error messages as a result. 

     

    All the project phases i want to filter for coincidentally include the letter t, so I've been trying: 

     

    substringof(Current_x0020_Phase, 't')

    {
     "status": 400,
     "message": "An unknown function with name 'substringof' was found. This may also be a function import or a key lookup on a navigation property, which is not allowed.\r\n inner exception: An unknown function with name 'substringof' was found. This may also be a function import or a key lookup on a navigation property, which is not allowed.\r\nclientRequestId: 12948adb-a95b-4481-a645-7e6260456f27",
     "source": "excelonline-ase.azconn-ase.p.azurewebsites.net"
    }

    and variations of this as posted in the link provided. This doesnt seem to work. 

     

    Edit. Also no luck using

     

    Project_x0020_Reference NE '' or Project_x0020_Reference NE 'Closed'

    {
     "status": 400,
     "message": "Invalid filter clause: unsupported operation. Only single 'eq', 'ne', 'contains', 'startswith' or 'endswith' is currently supported.\r\nclientRequestId: 41cc9017-7078-4849-bf0a-7ebc3abd9cb5",
     "source": "excelonline-ase.azconn-ase.p.azurewebsites.net"
    }
  • Verified answer
    v-bacao-msft Profile Picture
    on 23 May 2019 at 06:21:23
    Re: Fitler array - multiple conditions

    Hi @RobinV86 ,

     

    I did a test on my side, please refer to the following method to configure Flow.

    • Use advanced mode of Filter array to integrate the two conditions.

    Expression reference:

    @or(equals(item()?['project phase'], ''),equals(item()?['project phase'], 'closed'))
    • After filtering out the expected rows, traverse Body of Filter array by Apply to each.
    • And the corresponding field value is obtained by way of item()['ColumnName'].

    Image reference:12.PNG

    Hope it helps.

     

    Best Regards,

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,651 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,999 Most Valuable Professional

Leaderboard
Loading started