Have you ever wished you could connect a portal to a JSON array? Portals and JSON arrays seem like they should be a natural fit, but FileMaker doesn’t offer us an obvious way to connect one to the other.
(Why would you want to do this? One use case would be to provide dynamic scrollable selection criteria for a report.)
At any rate, today we’re going to take a look at a little proof-of-concept I threw together to enable portals to display and edit data in JSON arrays. In a real-world implementation, the JSON would likely be sitting in a $$variable, which, among other things, would help make the technique multi-user friendly. Here, in the interest of simplicity, I’ve opted to store the JSON in a regular text field. A couple benefits of doing so:
- You will see changes made in the portal immediately reflected in the JSON, and vice-versa.
- As you navigate from record to record within the demo, the portals will reconfigure themselves to accommodate the corresponding JSON.
(Yes, it’s possible to accomplish the preceding with variables as well, but the aim here is to keep things simple).
Demo file: connecting-portals-to-json-arrays.zip