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

ValueListSelectedIndex ( File ; ValueList ; Value )

Rate this function:  

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

Rob Poelking, Excelisys
http://www.excelisys.com

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

Description:

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 BrianDunning.com. Please contact the individual developer with any questions or problems.

This is my Custom Function and I want to edit it

Discuss:

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

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

Rich,

Shoot me an email direct - rob@excelisys.com

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:
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 2 + 1 =
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. NumberToHexadecimal(NumberValue)
  (Fri, Dec 08, 8:54am)
2. Get_BaseTable
  (Thu, Dec 07, 4:27pm)
3. JSONCreateVarsFromKeys ( json ; namespace )
  (Wed, Dec 06, 8:21pm)
4. GetTableNzme ( field )
  (Tue, Dec 05, 9:16pm)
5. TimeFormatAsText ( theTime )
  (Mon, Nov 13, 1:59pm)
6. ParseWebValueList( text )
  (Thu, Nov 02, 9:52am)
7. SVG_HTML_to_Text ( _svg_text ; _orig_text ;
  (Wed, Oct 25, 4:17am)
8. decFromHex ( hexValue )
  (Mon, Oct 16, 12:34pm)

RSS Feed of Custom Functions