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.

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


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 10 comments

Works a treat - thanks

Mike Scott, Liverpool, UK
November 15, 2012 1:56am

Hi All:

Firstly Rob thanks for posting.

I am new for FM coming from 4D.

I want to find the list item chosen (row, element number) so I think this is what I need.

I created the Function by coping it (Manage ->Custom Functions).
When I do that I am prompted to enter Parameters for "file", "ValueList" and 'Value" (note in the code there is "file" and "File". (?same).
So if I enter "file", "ValueList" and 'Value" as the parameters I can save the Function.

Now, how do I use it/connect it to the process of selecting a list item, to get the list item number chosen from a list, name "Color".

You have the first parameter (file) in the function as "" (null string) and the Value field will be where I will store the result.
I dont see a way to assign the file parameter from the File list (you can only assign Fields).

Would really appreciated a bit more details on how to assign the parameters correctly and hook this function to the choosing of the list.

Thanks again


Sel, Bellevue, WA
June 08, 2013 4:53pm

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

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 + 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. interpolation (y1; y2; y3; x1; x2; x3; x1y1; x2y1; x1y2; x2y2; rnd)
  (Sat, May 19, 3:55am)
2. @JSONFormatElements ( json )
  (Tue, May 15, 3:31am)
3. WindowNamesAll ( dbNames ; excludeCurrentWindow )
  (Sat, May 12, 11:34am)
4. RandomChoiceFromList ( values ; required )
  (Wed, May 02, 6:35am)
5. @JSONFormatElements ( json )
  (Fri, Apr 27, 7:31am)
6. MBS-OCR ( language ; Image )
  (Mon, Apr 23, 1:48pm)
7. MBS_Image_Rotate ( Picture ; rotation )
  (Mon, Apr 23, 1:27pm)
8. UnQuote ( string )
  (Tue, Apr 10, 12:34pm)

RSS Feed of Custom Functions