Better UI Settings

Longtime FileMaker developers have often used the database itself to store values for various user interface settings. This is valid, because, where else would you store them? A common approach is individual fields. However, there are a few problems with this.

First, it adds "noise" to your data structure, making it harder to distinguish between actual data fields and those used for other purposes. For example, you might ask, "Is this an actual data field or is it used for something else?"

Second, FileMaker’s data transfer over the network is essentially all or nothing because every field in a table must be transferred. I've seen solutions with literally thousands of fields - every one of them, and their contents, is being sent over the wire.

This is not an ideal situation, but it can be easily mitigated by migrating to a system that addresses both issues. Furthermore, you can take additional steps to move this data just one table away and still maintain the same benefits for your user interface.

This video presents a modern approach to managing your user interface settings. By learning from it, you may also gain insights into other ways to use JSON in your development.

AttachmentSize
ServiceOrderSolution.zip1.08 MB
Tags:
UI

Comments

If I were to move all ui display fields into a json field. You might have a json that looks like this {"UI":{"displayActive":true,"displayFavorite":false}}. How would you suggest performing a find to get all UI,displayActive that are true.

JSON manipulation is very much possible. These are the tools I've used. Native: JSONQuery (custom function) MBS-Plugin: JSON.Query. Via a plugin: jq which is possible with bBox and BaseElements I've also loaded JSONata into the JavaScript engine provided by MBS and made a useful custom function.

The fastest I've worked with is jq. VERY performant! If you're on a mac I highly suggest trying it out via the BaseElements plug-in because you can try it for free.

My go to is MBS because I really don't run FileMaker without it. JSONQuery is a great effort, but it suffers from the lack of performance that comes with anything native.

Plus, you can go WAY beyond just searching JSON. You can complete rearrange it and do all kinds of cool stuff with the tools above. One of the best possible tool combinations is Execute Data API as a script step then just transforming that result into whatever format you need with some of the above tools.

-- Matt Petrowsky - ISO FileMaker Magazine Editor

using BaseElements and the BE_JSON_jq ( Layout » URL::json; ".. | objects | select(" & ~search & " == " & ~boolean ) where ~search and ~boolean are variables; curious would you suggest using the customList function to grab a list of IDs in a global field and show these records in a found set or is that way too much payload at scale. Thanks for this video.