cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
audrieg
Power Automate
Power Automate

Shorter Expression with Contains Operator

I using this long expression to exclude all Apple SKUs, I bet there is a contains operator but I couldn't find it. Do you know one that would shorten this expression?

 

Filter(FruitTable.Title, !(Title = "Apple Brand 1") && !(Title = "Apple Brand 2") && !(Title = "Apple Brand 3") && !(Title = "Apple Brand 4"))

 

I would like to exclude all titles containing the word "Apple".

 

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
hpkeong
Community Champion
Community Champion

Hi

 

May you try:

- Filter(TableFruit, !(Left(Fruit, 5) = "Apple"))

 

Field Titles: Fruit & Qty.

 

Screenshot (173).png

 

 

Hope it helps!

hpkeong

View solution in original post

5 REPLIES 5
hpkeong
Community Champion
Community Champion

Hi

 

May you try:

- Filter(TableFruit, !(Left(Fruit, 5) = "Apple"))

 

Field Titles: Fruit & Qty.

 

Screenshot (173).png

 

 

Hope it helps!

hpkeong

View solution in original post

Left expressions won't work because they will eliminate more than just those containing Apple

(I hope you realize this is a filter on a column in a data source - there is no text box holding this information on my screen yet.)

 

Lower() might work. I'll try that and let you know if it works.

 

Thanks for your comments!

hpkeong
Community Champion
Community Champion

Hi

 

I had just edited with example.

See if it works.

hpkeong

YOU are awesome!

 

Because I had other && statements around it, I modified it very slightly to:

 

&& !(Left(Title,5)="Apple") &&

 

THANK YOU!

hpkeong
Community Champion
Community Champion

Hi

 

Welcome, Audrieg.

I am learning, too, from all of you.

 

Have a nice day.

[Today is Malaysia Day! Share my joy with you!]

hpkeong

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (3,162)