Brian Dunning's FileMaker Custom Functions

FoundList ( field ; start )

List the values of a field across a found set

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

Eilert Sundt   Eilert Sundt
Eilert Sundt Systemdesign
http://www.eilert.no

Share on Facebook Share on Twitter

  Sample input:
FoundList ( ID ; 1 )
  Sample output:
10011
10022
10025

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

This cf returns a list of the values in a designated field across the current found set.

 

Comments

Heather   Heather, Macomb, IL
Jun 10, 2011
This was very helpful to me. Thank you.
 
Joycelyn   Joycelyn, Gaithersburg,MD
May 15, 2013
I'm using the custom function above to collect emails across a found set. The function works, however I'm getting a bunch of "?" marks after the results. For example,

joyce@email.com
who@email.com
?
?
?
?
?

How can I fix this so that all I see are the results?
 
Matthias Bitterlich   Matthias Bitterlich, Berlin/Germany
Aug 22, 2013
Hi,

I love this function , this is what I was looking for soooo long.
A shame that I could not come up with this myself as my brain melts if it's about loops.

Warm regards,
Matthias
 
Garrett Debski   Garrett Debski, Irving, TX
Apr 1, 2014
I changed this to include a "stop" so the function does not have to evaluate the current found set every loop. You can easily pass the function the current found set.

FoundList ( field ; start ; stop )

// start should always be set to 1

GetNthRecord ( field ; start ) &
Case (
start < stop ;
"¶" & FoundList ( field ; start + 1 ; stop )
)
 
Patrick Reagan   Patrick Reagan, Altadena, CA
Jul 24, 2014
To avoid indirection problems, here's a slight adjustment...

Call the custom function with a GetFieldName() FM function:
cf_FoundList(GetFieldName(MEMB__members::status_life__t); 1)

Have the custom function Evaluate the field name:
// start should always be set to 1
GetNthRecord ( Evaluate(field) ; start ) &
Case (
start < Get ( FoundCount ) ;
"¶" & cf_FoundList ( field ; start + 1 )
)
 
Robet Schaub   Robet Schaub, East Hampton, CT
Nov 26, 2015
This is a Great CF. I use it a lot. Heads up there is a limit to 10k in list. go to 10K + 1 and you get ?
 
Eric M.   Eric M., San Jose, CA
Jan 24, 2016
Doesn't work on related fields, only field from the current table.
 
Greg J   Greg J, Chicago, IL
Jan 31, 2017
I noticed a problem when there are more related records than in the current found set, to remedy this I replaced the get( foundcount ) bit with count( field ) instead. this will count current and related records more accurately.

thank you for your useful CF, I hope my change helps others running into the same issue I had.
 
Daniel   Daniel
Jul 17, 2017
Re: Greg J

It sounds like you are using this custom function to get a list of related records? Instead you should be using the native "List()" function.
 
Bart   Bart, Poland
Nov 14, 2017
Hi, thanks for great function.

This is my variation due to extreamly slow FM get functions i think passing found count as value is much faster.
GetNthRecord ( field ; start ) &
Case (
start < found_count;
"¶" & found_set_field_list ( field ; start + 1; found_count )
)
 

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: