cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
martinav
Super User
Super User

I need help writing a filter in the expression builder

I am working on a crazy complex flow simply to be able to search for a filename in a directory that has mixed case.  I have a filename to look for, but the case can be anything.  I have it all completed, except for the case where I can get a partial return on my search.  The only think I need to do now is to filter for the situation that the length of my search result must be the same number of characters as my search for text.  That way, I dont get a 999996.pdf returned for a 96.pdf search.  Make sense?

 

Here is my block.  I want this table to contain "Name" only when "Name" is the same number of characters as my variable "NameLength".  The basic logic is:

 

if(length(Name)=NameLength,Name,null)

 

2018-12-07 14_06_47-Edit your flow _ Microsoft Flow.png 

 

I have no clue how this can be written in the MS Flow Expression builder.  I have done some basic string and math, but not an if statement.  Help online is so sketchy.

1 ACCEPTED SOLUTION

Accepted Solutions
martinav
Super User
Super User

I worked on it a litte, and came up with this.  I think i'm back in the game now. 

 

if(equals(length(item()?['Name']),variables('NameLength')),item()?['Name'],null)

 

 

2018-12-07 14_23_47-Edit your flow _ Microsoft Flow.png

View solution in original post

1 REPLY 1
martinav
Super User
Super User

I worked on it a litte, and came up with this.  I think i'm back in the game now. 

 

if(equals(length(item()?['Name']),variables('NameLength')),item()?['Name'],null)

 

 

2018-12-07 14_23_47-Edit your flow _ Microsoft Flow.png

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022- Season 2 has kicked off!

Users online (3,856)