
…which sends you through some CAPTCHA contortions, then generates a URL like this. One neat feature of the Exerciser is the ability to save and share examples, by clicking this icon… Here I worked out the syntax for another example which you can find in the demo file - in this case generating statistics for sample orders. If you want to experiment with JSONata, you will find it helpful to play in the above-mentioned Exerciser. You can also pass the result back to the calling script like so: Here’s a simpler example with one of my favorite features: the ability to extract values corresponding to a key regardless of that key’s location within the JSON. (Though, to be fair, it took me a while to get the syntax correct, and I wouldn’t have attempted it had I not seen this example in the JSONata documentation.)

Here’s another one - for a given set of orders, find the customers whose total sales are > 3x above average.ĭo you need JSONata to answer a question like this? Of course not, but consider the time and effort you would invest using the standard FileMaker tool set. Since each country entry includes a “timezones” array, I decided to query those arrays for countries with more than two time zones.

For instance, in the above example, the source JSON comes from. In the demo you’ll find examples that convey a tiny bit of what’s possible with JSONata. Instructions: choose an entry on the left, then click “Get result into the field” to see results. Note: the demo requires an online connection to access the JSONata library. If you’d like to learn more re: what’s going on under the hood, Jeremy goes into specifics here: Towards a Better JS Development Environment. Okay, a JSON query and transformation language sounds intriguing, at least in theory, but wouldn’t it be great if we could harness that power from within FileMaker? Well, now we can, utilizing techniques in this demo, built by Jeremy and shared here with his permission.ĭemo file: JSONata.zip (requires FM 19+ on Mac, 19.3+ on Windows)Īs you’ve probably surmised, the demo makes use of the Perform JavaScript in Web Viewer script step.
