Brian Dunning's FileMaker Custom Functions

GetNthRecordSetFilter ( outputField ; conditions )

Grabs value of a field for all records in a relationship that match given conditions.

  Average rating: 5.0 (1 vote) Log in to vote

Ethan   Ethan - Show more from this author
Tactile Medical
https://www.linkedin.com/in/ethyoder

Share on Facebook Share on Twitter

  Sample input:
GetNthRecordSetFilter (
GetFieldName ( Person::PrimaryKey ) ;
JSONSetElement ( "[]" ;
[ "[0]field" ; GetFieldName ( Person::DOB ) ; JSONString ] ;
[ "[0]operation" ; ">=" ; JSONString ] ;
[ "[0]value" ; "01/01/2000" ; JSONString ] ;

[ "[1]field" ; GetFieldName ( Person::FName ) ; JSONString ] ;
[ "[1]operation" ; "bw" ; JSONString ] ;
[ "[1]value" ; "T" ; JSONString ]
)
)
  Sample output:
All the primary keys for people:
- born after 2000
- with a first name that starts with T

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

Grabs value of a field for all records in a relationship that match given conditions. Basically, it is a way to filter a set of records through a relationship without changing or adding a TO and listing all of their IDs (or whatever other field you want to grab).

The conditions parameters needs to be a JSON array of objects. Each object should contain "field" (the field you're checking), "operation" (the operator you want to use while checking), and "value" (the value you want to check against the field). The list of operators you can send are located in the Compare function (https://www.briandunning.com/cf/2542).

I would not use this on records set that are larger in size because it will probably not be very fast, however I have not done any testing for this. The most records I've tested this on is around 20.

 

Comments

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: