cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Resident Rockstar
Resident Rockstar

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
Highlighted
Resident Rockstar
Resident Rockstar

Re: I need help writing a filter in the expression builder

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
Highlighted
Resident Rockstar
Resident Rockstar

Re: I need help writing a filter in the expression builder

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

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (6,828)