Software Venture Consulting

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

Free Web Tools
Free FileMaker Tools

Personal Pages

Shopping Cart
Shopping Cart


Free Newsletter


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


Rate this function:  

  Average rating: 4.5  (31 votes)
  Discuss this Custom Function

Rob Atkinson, Webwyz Systems

Examines a list of values, removing lines that do not contain a given filter value.

Sample Input:
"Joe Smith BC 95
Fred Jones AB 96
Gail Peters NB 98
Herb Gardner SK 95";
Sample Output:
Joe Smith BC 95
Herb Gardner SK 95

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


Many solutions have a field where a log is written line by line - for revisions, modifications, etc. Usually a carriage return is used to separate each line.
As the system ages, records can end up with a single field containing hundreds of log entries - detailing a wide variety of information.
Use filterLines to recursively search a text field, line by line for a given value. Only lines containing that value is returned.
Each line must be separated by a carriage return(ΒΆ).

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

This is my Custom Function and I want to edit it


Can also be written as:

filterLines( filterField; filterValue )

Case( IsEmpty( filterField );"" ;

Let ([
numValues = ValueCount( filterField );
topValue=LeftValues ( filterField; 1 );
match=Case(PatternCount(topValue; filterValue); topValue);
remainValues=RightValues( filterField; numValues-1)];

match & filterLines( remainValues; filterValue)

Bruce Robertson, Redmond WA
January 14, 2012 6:43pm

Thanks Bruce! Much neater and more concise.

Rob Atkinson, Vancouver
January 15, 2012 11:13am

If you have a really long log, you might run into the recursion limits doing this (10,000). Thus, it might be better to take a page from the Unix grep utility and do this line by line. That is, use a script to:

-- put the lines in a variable
- iterate through the lines
- for each line, if a match copy the line to an output variable
- return the output variable

Derek Bastille, Fairbanks, AK
January 17, 2012 6:36pm

You are right Derek - I should have pointed this out. The function isn't suitable as a "real" log parser. I originally proposed something similar to your solution to my client.

The client didn't like that because it wasn't dynamic. Every record you had to run the script..every time you looked at the log.

The client was saving the username, along with what was modified in a field. They had thousands of records containing 0 to 500 revisions.
They just wanted to be able to enter a username and see what they had changed.
However, you point out an important limitation.

Rob Atkinson, Vancouver, B.C.
January 18, 2012 7:51am

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

Your Name:
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 0 + 9 =
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. HexUUIDToNum_cf (_uuid)
  (Sat, Jun 16, 1:55pm)
2. httpResponseCode ( responseHeaders )
  (Tue, Jun 12, 10:40pm)
3. FindDuplicateCharacters ( string )
  (Fri, Jun 08, 5:01pm)
4. FieldRepetitionLast ( field ; maxRepetition )
  (Wed, Jun 06, 6:05pm)
5. CountModifiedRecords ( NameTimestampField ; StartTimestamp ; EndTimestamp )
  (Mon, May 28, 8:23am)
6. JSONArrayLength ( JSONArrayStr )
  (Fri, May 25, 7:46am)
7. interpolation (y1; y2; y3; x1; x2; x3; x1y1; x2y1; x1y2; x2y2; rnd)
  (Sat, May 19, 3:55am)
8. @JSONFormatElements ( json )
  (Tue, May 15, 3:31am)

RSS Feed of Custom Functions