Brian Dunning's FileMaker Custom Functions

ListValues ( Field )

Return return separated value of Field data in current found set.

  Average rating: 4.2 (38 votes) Log in to vote

Koji Takeuchi   Koji Takeuchi - Show more from this author
TonicNote, Inc.
https://tonicnote.com

Share on Facebook Share on Twitter

  Sample input:
ListValues ( nameFirst )
  Sample output:
"Shin¶Koji¶Kazuhiko¶¶Satsuki¶Kaori"

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

ListValues ( Field )
2011.06.28, Koji Takeuchi


description:
Return return separated value of Field data in current found set.
ex.
nameFirst = "Shin" on record 1, "Koji" on record 2, "Kazuhiko" on record 3, "" on Record 4, "Satsuki" on record 5, "Kaori" on record 6

ListValues ( nameFirst )
-> "Shin¶Koji¶Kazuhiko¶¶Satsuki¶Kaori"

 

Comments

Bob   Bob
Jun 28, 2011
Works in found set, however it works only as the List function does. I have a newly created file with all 447440 Canadian Zip Code. I a small found set it works, I chose City for my list. It does not filter out all the many duplicates.

When I have the file in a show all mode . forget it the file and FileMaker freeze and have to force close.
 
Maarten Witberg   Maarten Witberg
Jun 28, 2011
As far as I tested, this function will list the field values of all records in a table (so not the found set). When deployed in a relational setup the function only returns one value instead of the list of values that are in the related records , in which case it does the same as List(). What am I missing in setting this up?
 
Maarten Witberg   Maarten Witberg
Jun 28, 2011
calc must be unstored... didn't see that
 
Bart Bartholomay   Bart Bartholomay, Vero Beach
Jun 28, 2011
There is already a Custom Function by Howard Schlossberg on this site entitled GetFoundSet( fieldname ), with the fieldname entered between quotes.
 
Fabrice   Fabrice, Brussels
Jun 29, 2011
CustomList ( 1 ; get ( foundcount ) ; "getnthrecord ( field ; [n] )" )

will work as well. Much faster and without 10,000 records limit.
 
John Davis   John Davis, Houston
Aug 13, 2015
Thanks Fabrice for the non-recursive option. The problem I have with CustomList is that it behaves like the native List function in FMP in that it doesn't list null values. In Koji's example data, his custom function will at least correctly include null values in the list. Agreed, though, I wish this was non-recursive.

The only non-recursive solution I know is actually using a script "Get Values in Found Set ( FieldName )" in Todd Geist's HyperList custom script module. It is also faster than CustomList and can capture up to 5 fields per record.

http://www.modularfilemaker.org/module/hyperlist/
 
Agnes Barouh   Agnes Barouh, Tic Tac
Oct 10, 2015
Hi,

For CustomList, If you want null value, you must say in your calculation, you tag null value :

Substitute (
CustomList ( 1 ; get ( foundcount ) ; """[.nv.]"" & getnthrecord ( field ; [n] )" ) ;
[ "[.nv.]" ; "" ] )

give the null value

HTH

Agnès
 
Edgar   Edgar, Boise, ID
Nov 30, 2016
Looking at Agnès comment above on how to include a null value

Substitute (
CustomList ( 1 ; get ( foundcount ) ; """[.nv.]"" & getnthrecord ( field ; [n] )" ) ;
[ "[.nv.]" ; "" ] )

I tried this and other variations of it, but could not make it work.

Any help on how to include records with null values in the list using CustomList, would be appreciated
 
Dennis Burnham   Dennis Burnham, Irving, TX
Apr 1, 2017
First name and last name are not interchangeable. I think there is a typo here:


nameLast = "Shin" on record 1, "Koji" on record 2, "Kazuhiko" on record 3, "" on Record 4, "Satsuki" on record 5, "Kaori" on record 6

ListValues ( nameFirst )
 
Koji Takeuchi   Koji Takeuchi, TonicNote, Inc.
Apr 1, 2017
Lol. You're right, Dennis.
Thanks, I corrected the field name.
 

Log in to post comments.

 

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

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 20 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: