cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

filtering array multiple conditions

Hi all,

 

I have a Excel table and I want to use filter array with multiple conditions but it doesn't work can someone help me out? I added a screenshot of my flow..

In the filter array i use the following expression:

 

@or(equals(item()?['Vestigingn'], '1'),equals(item()?['Vestigingn'], '3'),equals(item()?['Vestigingn'], '6'),and(not(equals(item()?['Vestiging'], 'col14.'))))

 

Anony_5-1618765387874.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Paulie78
Super User III
Super User III

The expression above works for me. To get you towards a solution may I suggest the following slightly different approach?

Have two filter actions:

First one:

or
	(
	  equals(item()?['Vestigingn'], '1'),
	  equals(item()?['Vestigingn'], '3'),
	  equals(item()?['Vestigingn'], '6')
	)

Then use a second filter with the results of your first filter action as the source:

not(equals(item()?['Vestiging'], '-'))

 Then at least you will be able see in the run history where your query is working/not working.

View solution in original post

20 REPLIES 20
DamoBird365
Community Champion
Community Champion

Hi @Anonymous 

 

not sure what your and does as it is one of the four or possibilities. Should it be both the and and 1 Of 3 Or?

 

I would arrange it as

and(notequalsetc,or(statement1,2,3)).

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien


P.S. take a look at my new blog here

Paulie78
Super User III
Super User III

The expression seems correct to me, but it is difficult to know without you explaining the objective and seeing some sample data. It makes more sense to me like this:

and
(
	or
	(
	  equals(item()?['Vestigingn'], '1'),
	  equals(item()?['Vestigingn'], '3'),
	  equals(item()?['Vestigingn'], '6')
	),
	not(equals(item()?['Vestiging'], 'col14.'))
)

But I don't think this will fix your problem. Have you got any more information you can provide?

Pstork1
Dual Super User III
Dual Super User III

To me there are a couple of issues with this.

1) I think the last Item name my be spelled wrong.  The other three are 'Vestigingn' but the last one is 'Vestiging'. It seems to be missing a final 'n'

2) Should the final And be part of the Or? If it is then the And is unecessary.  If its not then the and and parentheses are in the wrong place. 

3) The 'col14.' also looks out of place based on the other values.

Try this instead

@And(or(equals(item()?['Vestigingn'], '1'),equals(item()?['Vestigingn'], '3'),equals(item()?['Vestigingn'], '6')),not(equals(item()?['Vestigingn'], 'col14.')))

 

 



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

I want all the output of the equals of vestigingn; 1, 2 en 3 but also the not equals of column vestiging: '-' (not col14 what I mentioned in my first message).

 

Anony_0-1618821246494.png

I want to use these values if the ['title']from Excel equals [Title]from sharepointlist

Anony_1-1618821542975.png

 

 

Anony_2-1618821767682.png

 

Anonymous
Not applicable

I tried it but it doesn't work.. 

I want all the output of the equals of vestigingn; 1, 2 en 3 but also the not equals of column vestiging: '-' (not col14 what I mentioned in my first message)

Anonymous
Not applicable

Hi,

 

it was not spelled wrong the Vestiging is another column and must not be equal to -

Paulie78
Super User III
Super User III

This should work:

 

and
(
	or
	(
	  equals(item()?['Vestigingn'], '1'),
	  equals(item()?['Vestigingn'], '3'),
	  equals(item()?['Vestigingn'], '6')
	),
	not(equals(item()?['Vestiging'], '-'))
)

 

But I am guessing here that Vestigingn is perhaps coming through as a number, so the above example would not work, so you could try:

 

and
(
	or
	(
	  equals(item()?['Vestigingn'], 1),
	  equals(item()?['Vestigingn'], 3),
	  equals(item()?['Vestigingn'], 6)
	),
	not(equals(item()?['Vestiging'], '-'))
)

 

or

 

and
(
	or
	(
	  equals(item()?['Vestigingn'], int('1')),
	  equals(item()?['Vestigingn'], int('3')),
	  equals(item()?['Vestigingn'], int('6'))
	),
	not(equals(item()?['Vestiging'], '-'))
)

 

Anonymous
Not applicable

i tried botch but the filter isn't working. I get the following output:

 

{
    "body": []
}
Paulie78
Super User III
Super User III

Let's take the guess work out of this:

  • Run your flow, or go into the run history.
  • Click on the filter action.
    • Click on "Show Raw Inputs"
    • Copy the Raw Inputs into your clipboard
    • Post the results here or on pastebin.com

Then we can check the content and construct the filter expression for you.

 

2021-04-19_13-06-22.gif

 

Anonymous
Not applicable

Hi because its privacy data and the input contains thousend of rows I cant show all the data inside it but this is a section of the data as input: 

 

[{"@odata.etag":"","ItemInternalId":"-","Col1":"73566643","Col2":"525323433","Afleverdatum":"14.04.2021","Col4":"02.04.2021","title":"7125324","Merk":"iets","Model":"Anders","Kleur":"","Meldcode":"3333","Col9":"5232413","Verkoper":"222","Vestigingn":"2","Vestiging":"Verkoop","col13":"25323422","Klantnaam":"lucht","col15":"","col16":""}

 

Paulie78
Super User III
Super User III

This works for me, but you already tried and it didn't work for you:

 

and
(
	or
	(
	  equals(item()?['Vestigingn'], '1'),
	  equals(item()?['Vestigingn'], '3'),
	  equals(item()?['Vestigingn'], '6')
	),
	not(equals(item()?['Vestiging'], '-'))
)

 

From your sample data it did not produce any result. Then I changed Vestigingn to 1 and it returned the result. I then changed Vestiging to - and no results were returned, which is how it should work right?

Anonymous
Not applicable

I want as result al the data from vestigingn 1,2,3. In this data is a column named 'Vestiging' but I dont need the data where these filled in with '-'

 

if I dont use the expression not(equals..... and only use or(equals.... than it works.

But i want to filter out everything where the Vestiging is '-' too

Paulie78
Super User III
Super User III

The expression above works for me. To get you towards a solution may I suggest the following slightly different approach?

Have two filter actions:

First one:

or
	(
	  equals(item()?['Vestigingn'], '1'),
	  equals(item()?['Vestigingn'], '3'),
	  equals(item()?['Vestigingn'], '6')
	)

Then use a second filter with the results of your first filter action as the source:

not(equals(item()?['Vestiging'], '-'))

 Then at least you will be able see in the run history where your query is working/not working.

View solution in original post

Anonymous
Not applicable

Thank you this worked! Can I add one more condition as follows?:

 

@not(equals(item()?['Vestiging'], '-')),not(equals(item()?['Vestiging'], 'aan'))

 

Paulie78
Super User III
Super User III

Something like this:

or
(
  not(equals(item()?['Vestiging'], '-')),
  not(equals(item()?['Vestiging'], 'aan'))
)
Anonymous
Not applicable

If i use:

 

or
(
  not(equals(item()?['Vestiging'], '-')),
  not(equals(item()?['Vestiging'], 'aan'))
)

it does not filtering anymore 

Paulie78
Super User III
Super User III

Try:

@or
(
  not(equals(item()['Vestiging'], string('-'))),
  not(equals(item()['Vestiging'], string('-')))
)
Anonymous
Not applicable

I tried it but it didnt work  either 

 

@or(not(equals(item()['Vestiging'], string('-'))),not(equals(item()['Vestiging'], string('Aan'))))

Anonymous
Not applicable

I added one more filter array thank you!

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Users online (1,562)