Training Day

JSONQuery

A powerful FileMaker custom function for querying, aggregating, and transforming JSON data.

Overview

JSONQuery is a FileMaker custom function authored by Steve Senft-Herrera that enables you to query JSON data in FileMaker 18 or later1.

Basic Capabilities

  1. Query - Find elements matching specific values with various operators
  2. Aggregate - Return aggregates (SUM, AVG, LIST, etc.) from matched elements
  3. Transform - Customize output format with selective attribute inclusion

Examples

This example will find all elements in the JSON string that have a DetailType of SalesItemLineDetail and return a list of their IDs.

JSONQuery(
	
	$lines ;					/*  JSON 	*/
	"DetailType" ;			    /*  TargetPath	*/
	"EQUALS" ;				    /*  Operator	*/
	"SalesItemLineDetail" ;	    /*  ComparisonValue	*/
	JSONString ;				/*  ValueType	*/
	""						    /*  ResultPath	*/
)

Resources

References

Footnotes

  1. Senft-Herrera, S. (2024). FMP_JSONQuery. GitHub. https://github.com/steve-ssh/FMP_JSONQuery

  2. Frank, K. (2024, September 16). JSONQuery 2.0 is Here. FileMakerHacks. https://filemakerhacks.com/2024/09/16/jsonquery-2-0-is-here/

On this page