cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Super User
Super User

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

1 REPLY 1
Super User
Super User

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

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 216 members 4,554 guests
Please welcome our newest community members: