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

MinValue ( lst ; value )

Rate this function:  

  Average rating: 3.9  (30 votes)
  Discuss this Custom Function

Theo Ros, n/a

Returns the smallest value in the list

Sample Input:
MinValue ( "apple¶grape¶banana" ; "" )
Sample Output:

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


Returns the smallest value in the list

Syntax: MinValue ( list ; value )
In: lst - the return delimited list to search
value - the value currently compared

Return type: Text

MinValue ( "apple¶grape¶banana" ; "" ) --> "apple"

Always start the function off with parameter 'value' = ""

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


Initially had troubles because the syntax uses a reserved word "List" (changed to listy as needed)


current = Substitute ( value ; "¶" ; "" )

looks like it should be ..

current = Substitute ( currentvalue ; "¶" ; "" )

after making those tweaks, it looks to be working just fine.

Dwayne Wright, Seattle
August 18, 2010 1:36pm

Thanks Dwayne for that!

I've updated this function and also the MaxValue function to use "lst" as parameter name instead of "list".

As for the part where it says: current = Substitute ( value ; "¶" ; "" )

that one was correct, because i used the function with the second parameter actually being called "value".

Mistakingly however in the descriptive part (Syntax:) i called it currentValue.
I changed that aswell

Theo Ros, The Netherlands
August 19, 2010 12:42am


I tried to understand and get this to work by renaming
variables, but the results are bogus.

Can you explain what is going on?

/* --------------------------------------------------------------------------- -----
Returns the smallest value in the lst

Syntax: ShortestString ( lst ; InitStr )
In: lst - the return delimited list to search
InitStr - the value currently compared

Return type: Text

ShortestString ( "apple¶grape¶banana" ; "" ) --> "apple"

Always start the function off with parameter 'InitStr' = ""

Theo Ros
* updated augustus 9, 2010: changed parameter name "list" to "lst"
thanks to Dwayne Wright
------------------------------------------------------------------- ------------- */

// If our list contains more than zero elements
If(ValueCount(lst) ;

// Then process:
// Initialize some variables:
// Select the next value, and strip out carriage return:
CompareStr = Substitute(LeftValues(lst ; 1 ); "¶" ; "" );

// Strip out carriage return:
CurStr = Substitute(InitStr ; "¶" ; "" );

// Set chunk of remaining strings:
RemainderStr = MiddleValues( lst ; 2 ; 9999999999 ) ;

// Which is the smallest string?
SmallStr = Case(IsEmpty(CurStr); CompareStr;
Length(CompareStr) < Length(CurStr) ; CompareStr;
) // End Case
]; // End Let

// If there are any strings remaining, recurse on this remainder:
If (ValueCount (RemainderStr); ShortestString(RemainderStr ;

Westenra, Moldova
May 09, 2016 9:11pm


first of, changing variable names is always a good way of figuring out how things work.
In your version, i can some things wrong.

First: you have mistakenly changed the comparison "next < current" into "Length(CompareStr) < Length(CurStr)" which is not correct, because now suddenly you do not compare the values themselves, but their length. This is not what the function is meant for.

Second: In the last part of the function, you have replaced the function name "MinValue" into a non-existing one called "ShortestString". MinValue is NOT a variable name, but the name of this function, so you should not have renamed that.
(what happens there is that the function calls itself for as long as the list has values. This is called Recursion)

Third: i believe you have left out the last part of the function, so now the final If (and also the function as a whole) is not complete.
Your If now is like this:
If (ValueCount (RemainderStr); ShortestString(RemainderStr ;

where it shoud be
If ( ValueCount ( rest ) ; MinValue ( rest ; low ) ; low )

Finally, to close the function after this If, you need to add two extra brackets:

) // End Let
) // End top If

Just one final tip: because in FileMaker all functions start with Capitals, i like to name my variables in camel-case, so they all start with lowercase characters. This helps in recognizing if something is a function name or a variable. ("compareStr", "curStr", etc.)

Hope this helps.


Theo Ros, Hilversum, The Netherlands
May 10, 2016 12:13am

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

RSS Feed of Custom Functions