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

GetNthRecSetUnq ( fieldName ; recordNumStart; recordNumEnd )

Rate this function:  

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

doug Jacobs, Restylers' Choice, LLC

Calculates a return delimited and sorted, values list from related, or local, field data. Eliminating duplicate values fromthe list.

Sample Input:
GetNthRecSetUnq(States,1,"") where there are multiple states

If field values are OH, OH, KY, IN, IN, IN....

it eliminates all duplicate values
Sample Output:

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


Creates a return delimited value list of the values from the field specified, beginning with the recordNumStart and ending with recordNumEnd. It only enters the first occurence of a value in the list. If an item appears multiple times it will only be in the list once.

The resultant value list's scope and sort are determined by the source field; thus for local fields the sort is determined by the current sort of records in the found set, for related fields it is by the relationship sort.

This single Custom Function can replace Copy All primary keys of a foundset practice as well as the use of ValueListItems() to create a value list of related values for other relationships.

This function is perfect for creating field value lists for selecting a range of records where the value list must change to reflect the data in the found set.


fieldName - Any local field, related field, or an expression that returns a field. NOTE: For repeating fields this Custom function will only see the first repetition, per record. Also, Globals will behave similarly and the global will be display once for each record.

recordNumStart - The record number from which you want to begin getting data. A null ("") or 0 value will set the start at the first record.

recordNumEnd - The record number after which you want to stop getting data. A null ("") or 0 value will evaluate until the the last record is reached. This parameter is inclusive, thus 10 will end the value list with the 10th record, including the contents of the field in that record.

Output Format:

A return delimited text value list of the the contents of fieldName dictated by the provided start and end record numbers.
Note: The result of GetNthRecordSet() will not be updated when the record referred to by GetNthRecordSet() is a record other than the one in which the calculation is currently being evaluated.


Given the following related Field data for Clients::State:
Related Record 1 = OH
Related Record 2 = KY
Related Record 3 = IN
Related Record 4 = OH

GetNthRecordSet ( Clients::State ; 2 ; 3 ) = OH¶KY¶IN

GetNthRecordSet ( Clients::State; "" ; "" ) = still returns OH¶KY¶IN due to it elminating duplicates

GetNthRecordSet ( ParentFirstName ; 30 ; "" ) = Value list beginning with the 30th parent name till the last record in current found set, in sort order.

Special Thanks: To Jonathan Mickelson, for posting the GetNthRecordSet function which was used as the basis for this version.

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


There's an error on your CF's parameters' it's supposed to be "recordNumStart" and "recordNumStart" end instead of "start" and "end", respectively.

Edward Lemos, Sao Paulo Brazil
November 01, 2009 10:21pm

This may be an error or my misunderstanding of how it is supposed to work.

If your related child record set is not sorted by the field you are working with, it just returns all values, not just one occurrence of each value.

Ed Uncle, Ware, UK
November 02, 2011 3:38am

I can't get this function to load. As noted above, there is an error with recordNumStart. What is the fix for this?

Cody, Houston, TX
April 02, 2012 10:44am

Got it working, but as Ed notes above, it does not seem to work apart from record entry order.

Cody, Houston, TX
April 03, 2012 9:00am

Cody could you explain how you managed to modify the function to get it working?

I've re-defined the parameters as mentioned by Ed, yet I can't seem to get parameters property specified.

Greg, Minneapolis, Mn
July 03, 2012 12:19pm

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 1 + 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. HexUUIDToNum_cf (_uuid)
  (Sat, Jun 16, 1:55pm)
2. httpResponseCode ( responseHeaders )
  (Tue, Jun 12, 10:40pm)
3. FindDuplicateCharacters ( string )
  (Fri, Jun 08, 5:01pm)
4. FieldRepetitionLast ( field ; maxRepetition )
  (Wed, Jun 06, 6:05pm)
5. CountModifiedRecords ( NameTimestampField ; StartTimestamp ; EndTimestamp )
  (Mon, May 28, 8:23am)
6. JSONArrayLength ( JSONArrayStr )
  (Fri, May 25, 7:46am)
7. interpolation (y1; y2; y3; x1; x2; x3; x1y1; x2y1; x1y2; x2y2; rnd)
  (Sat, May 19, 3:55am)
8. @JSONFormatElements ( json )
  (Tue, May 15, 3:31am)

RSS Feed of Custom Functions