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

ValueListSelectedIndex ( File ; ValueList ; Value )

Rate this function:  

  Average rating: 4.0  (32 votes)
  Discuss this Custom Function

Rob Poelking, Excelisys

Returns the number of the selected value in a list

Sample Input:
ValueListSelectedIndex ( "" ; "MyValueList" ; myField )
Sample Output:
6 when myField has selected the 6th value from a value list.

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


Data type returned: Number

Given a list of paragraph separated values, this returns the number of the item selected by a user. If a user selects the third value in a list, then the function returns 3.

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


5 most recent comments | Show all 12 comments

Hi Sel,

I will try to answer you briefly because I don't want to abuse Brian's tool here.

First, the parameter "file" is optional. If you do not assign it, then the function will assume that the value list you are trying to reference is located within the working file. Adding this parameter allows you to reference a value list in a different FileMaker file. If you want to specify the file, then simply quote it as a string constant [ ValueListSelectedIndex ( "my_file.fp7" ; "MyValueList" ; myField )].

Next, let me again point out that what this function returns is an index value for a selected item. If you assign a field with a value list of "Fruit Options" and "Fruit Options" is a list of fruits, if a user selects "Pineapple" in that field and "Pineapple" is the 5th item in that list, this function returns 5.

And as to the use of "file" and "File", yes, they are the same. FileMaker is not case sensitive in functions.

If you need more help, you can track me down from one of the sales guys at Excelisys by going to our web site.

I have some additional functions based around this one as well that allow you to build a custom list on the fly, or reverse the process and select an item from a list passing in the index value.

Rob Poelking, Cleveland, Ohio
June 10, 2013 6:06am

Hi, I must admit I'm really not that familiar with Filemaker, but I've taken over a club student records database for a martial arts club, where each student has their belt 'grade' in a field which is usually entered via a drop-down from a value list.

There is an existing script which scans through the student records and updates any selected records with the date of their last exam. What I need to do is to have their grades automatically update to the next value in the list. Would really appreciate any pointers on how I could do that!

Rich, UK
February 06, 2014 5:13am


Shoot me an email direct -

Rob Poelking, Cleveland, OH, USA
February 06, 2014 5:34am

Not accurate for all cases if value contains 24 and 424. So need to make it unique to avoid that one value is part of another.

For example, putting special marks at both sides become: ~24¶, ~424¶


file = if ( isempty ( file ) ; get ( filename ) ; file ) ;
items = ValueListItems ( File ; ValueList ) ;
items = Substitute ( items ; "¶" ; "¶~" ) ;
Value = "~" & Value & "¶" ;
items = If ( Right (items ; 1 ) <> "¶" ; items & "¶" ; items )
PatternCount (
Left (
items ;
Position ( items ; Value ; 1; 1 ) + Length ( Value )
) ; "¶"

Uuree G, Japan
June 28, 2018 9:19pm

Forgot putting Initiator at beginning

items = If ( Left (items ; 1 ) <> "~" ; "~" & items ; items )

Uuree G, Japan
June 28, 2018 9:24pm

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 3 + 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. ChiSquare3x2 ( param ; param ; param ; param )
  (Tue, Aug 14, 6:33am)
2. ReverseByteOrder ( bytes )
  (Thu, Aug 09, 12:06pm)
3. BytesToDec ( hex )
  (Thu, Aug 09, 11:47am)
4. GetAsHexBytes ( number ; bytes )
  (Thu, Aug 09, 10:50am)
5. ValCorrelationCoeff ( XValueList; YValueList; Xmean; Ymean; XStdDev; YStdDev )
  (Wed, Aug 08, 4:17pm)
6. ValLeastSquaresSlope ( XValueList; YValueList; Xmean; Ymean )
  (Wed, Aug 08, 4:10pm)
7. ValueMath ( List1 ; List2 ; operation )
  (Wed, Aug 08, 4:05pm)
8. GetExtension ( File )
  (Tue, Aug 07, 10:22am)

RSS Feed of Custom Functions