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
firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Users online (6,139)