Software Venture Consulting

FileMaker Pro downloads & Resources
FileMaker Custom Functions
FileMaker Web Viewer Examples
FileMaker Pro & Lasso Consulting
Training
FileMaker Books
FileMaker Articles
FileMaker Error Reference

Free Web Tools
Free FileMaker Tools

Personal Pages
Videos
Adventures
Links

Shopping Cart
Shopping Cart

Search:

Free Newsletter
Signup


Contact


Privacy Policy



FileMaker is a registered trademark of FileMaker, Inc. in the U.S. and other countries.

 

 FileMaker Pro Custom Functions

List  |  Show Random  |  Upload  |  Add This to Your Site

FilterList ( ListA ; Attribute ; ListB ; CaseSensitive )

Rate this function:  

RatingRatingRatingRatingRating
  Average rating: 4.2  (80 votes)
  Discuss this Custom Function

Agnes Barouh, Tic Tac
http://www.tictac.fr/CoinFileMaker/Page.html

to compare and filter values, lists with different attribute : Equals - NotEquals - Contains - NotContains - BeginsWith - NotBeginsWith - NotEndsWith - EndsWith

Sample Input:
FilterList ( "One¶Two¶three¶Four¶five" ; "BeginsWith" ; "F¶t" ; 1 )
Sample Output:
three¶Four


 Then copy & paste into FileMaker Advanced's Edit Custom Function window.

Click here to copy To Clip Manager if you have myFMbutler's Clip Manager installed

Description:

- - **calculation modified the 05/09/11 **- - ** update in the code for filter # or | or [ and ]

- - **calculation modified the 06/29/09 **- - ** Major-update in the code for greater speed (I see trouble with Evaluate and substitute, when search is in the first caractere of the list : search is "Contains z" and the list are zGlobalA¶zGlobalB¶zGlobalC ...) ok now

- - **calculation modified the 09/29 **- - ** no return Tag ( #|# ) when attribut is Equal and caseSensitive is < 1
- - **calculation modified the 31/05 **- - ** Change one substitute (case "not" )
- - **calculation modified the 27/05 **- - ** Change Tag | -> #|#
- - **calculation modified the 25/10 **- - ** Change :Addition of NotBeginsWith and NotEndsWith ** Change : remove the final ¶ when I used FilterValues **
- - **calculation modified the 15/04/08 **- - ** IF isEmpty listA or isEmpty ListB

Not recursive Function - Optional Parameters : Case Sensitiveness ( boolean format or null )


* FilterList () requires CustomList ( start ; End ; Function )
http://www.briandunning.com/cf/868

-> Attributes :
Equals - NotEquals - Contains - NotContains - BeginsWith - NotBeginsWith - NotEndsWith - EndsWith
-> CaseSensitive :
Boolean

----------------------------------------- *
FilterList ( "Thank¶you¶very¶much¶ Ugo Di Luca ¶And¶Fabrice Nordmann" ; "BeginsWith" ; "ve¶mu" ; "" )
----------------------------------------- *

----------------------------------------- more examples

FilterList ( FieldNames ( Get ( FileName ) ; Get ( LayoutName ) ) ; "NotContains" ; "Z¶zkp¶_" ; 1 )
Result = FieldNamesList Without the field whose name contains Z, zkp or _

FilterList ( Texte ; "Contains" ; "$¶_" ; 0 )
Result = values list With contains $ or _

FilterList ( LayoutNames ( Get ( FileName ) ) ; "EndsWith" ; "Dev" ; 1 )
Result = LayoutNames list whose the end name is Dev

FilterList ( List ( Table::MyField ) ; "Contains" ; Left ( FieldX ; 1 ) & ¶ & Middle ( FieldY ; 3 ; 3 ) ; "" )


----------------------------------------- more détails

--------- CaseSensitive = empty or 0

FilterList("One¶Two¶three¶Four¶five";"Equals";"One¶four";"" or 0 ) | Result => "One¶Four"
FilterList("One¶Two¶three¶Four¶five";"NotEquals";"One¶four";"" or 0 ) | Result => "Two¶three¶five"
FilterList("One¶Two¶three¶Four¶five";"Contains";"O¶t";"" or 0 ) | Result => "One¶Two¶three¶Four"
FilterList("One¶Tow¶three¶Four¶five";"NotContains";"O¶t"; "" or 0 ) | Result => "five"
FilterList("One¶Two¶three¶Four¶five";"BeginsWith";"F¶t";"" or 0 ) | Result => "Two¶three¶Four¶five"
FilterList("One¶Two¶three¶Four¶five";"NotBeginsWith";"F¶t";"" or 0 ) | Result => "One"
FilterList("One¶Two¶three¶Four¶five";"EndsWith"; "o¶E";"" or 0 ) | Result => "One¶Two¶three¶five"
FilterList("One¶Two¶three¶Four¶five";"NotEndsWith"; "o¶E";"" or 0 ) | Result => "Four"

--------- CaseSensitive = 1

FilterList("One¶Two¶three¶Four¶five";"Equals";"One¶four" ; 1 ) | Result => "One"
FilterList("One¶Two¶three¶Four¶five";"NotEquals";"One¶four" ; 1 ) | Result => "Two¶three¶Four¶five"
FilterList("One¶Two¶three¶Four¶five";"Contains";"O¶t"; 1 ) | Result => "One¶three"
FilterList("One¶Two¶three¶Four¶five";"NotContains";"O¶t" ; 1 ) | Result => "Two¶Four¶five"
FilterList("One¶Two¶three¶Four¶five";"BeginsWith";"F¶t"; 1 ) | Result => "three¶Four"
FilterList("One¶Two¶three¶Four¶five";"NotBeginsWith";"F¶t"; 1 ) | Result => "One¶Two¶five"
FilterList("One¶Two¶three¶Four¶five";"EndsWith";"o¶E"; 1 ) | Result => "Two"
FilterList("One¶Two¶three¶Four¶five";"NotEndsWith";"o¶E"; 1 ) | Result => "One¶three¶Four¶five"


Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

This is my Custom Function and I want to edit it

Discuss:

Note: To install this custom function you must first install a second custom function called "CustomList".

See: http://www.briandunning.com/cf/868

Matthew Fero, Seattle
August 07, 2011 3:54pm

Hello,

The function does not work well if the second list contains nothing. In this case the function returns the first result list.

CesarRG, Oviedo (Spain)
May 31, 2013 5:06am

Hello,

Yes, is my choice when I wrote this function : the calc are
" IsEmpty ( ListB ) ; ListA ;"

There was a discussion about it on the forum French, what is the logical result if ListB was empty... you can not put "IsEmpty (ListB), "";" because the result must depend on the selected attribute and I did not want to burden the already complicated calculation.
For Equal : IsEmpty ( ListB ) ; ""
For Not Equal : IsEmpty ( ListB ) ; ListA ;
For Contains or Not Contains.... What should be the result... The same for the other.

The easiest way was for me to decide if ListB was empty, the result was ListA.

But you may be right, I do not know.

Agnès

Agnès, Paris
May 31, 2013 7:24am

Will this function accept global variables ($$myVariable) as ListA or ListB?

Dave, Birmingham, AL
June 12, 2015 10:43am

Make a comment about this Custom Function (please try to keep it brief & to the point). Anyone can post:

Your Name:
City/Location:
Comment:
characters left. If you paste in more than 1500 characters, it will be truncated. Discuss the function - advertisements and other useless posts will be deleted.
Answer 4 + 7 =
Search for Custom Functions:

Custom Functions Widget
Download the Custom Function Dashboard Widget for OS X
Keep all the latest Custom Functions right at your fingertips!

Newest Custom Functions:

1. decFromHex ( hexValue )
  (Mon, Oct 16, 12:34pm)
2. MonthYearList ( startmonth ; startyear ; numbermonth ; short )
  (Mon, Oct 16, 3:38am)
3. ErrorDescription ( errorNumber )
  (Wed, Sep 27, 2:51am)
4. decodeEntities (text)
  (Wed, Sep 27, 1:22am)
5. HexidecimalToNumber ( HexidecimalValue ; counter )
  (Mon, Sep 25, 12:39pm)
6. FixedFieldConverter ( Fieldname ; f1 ; f2 ; f3 ; f4 ; f5 ; f6 ; f7 ; f8 ; f9 ; f10 ; f11 ; f12 ; f13 ; f14 ; f15 ; f16 ; f17 ; f18 ; f1
  (Fri, Sep 15, 12:34pm)
7. ShannonEntropy ( text )
  (Thu, Sep 07, 5:59am)
8. LetterCount ( text ; summary )
  (Thu, Sep 07, 5:53am)

RSS Feed of Custom Functions