3 Key Uses for Portals
Personally, I've always been dismayed by how portals are positioned within the world of FileMaker instruction. When I see other developers teach about portals, they start with the primary use of portals and then stop. They talk about how portals are there to show related data and that's about it. No way! That's certainly not the end of things. Portals are one of the primary ways to present data however you wish.
If portals were limited to simply showing related data based on a normalized schema structure, then we'd never have the flexibility we have within FileMaker. If you approach portals from the mindset of using them as a display tool, then you come up with all kinds of things you can do. There are three primary uses for portals - at least, this is how I personally think about them.
In this video, I show you what those three key uses are and how to actually implement them. If you're a beginner, then understanding the native portal is certainly the starting point. From there, you progress to the power-developer who uses the Multi-Key global and VirtualList approaches to using portals. This video covers all the core uses and gives you the foundation you need for using portals within FileMaker.
Comments
Virtual lists
I wish you wold go into detail with virtual lists
Peter Cortiel
Other videos will be made.
The Virtual List technique has been around for quite some time. If you'd like to see an earlier example which uses it for a sidebar menu then download this older file here.
-- Matt Petrowsky - ISO FileMaker Magazine Editor
Virtual List Portal
Matt,
I understand your demonstration of the Virtual List portal, but I can't think of a practical use for this in a FileMaker database. Can you provide an example of its use?
A sidebar menu that dynamically changes from layout to layout.
Because your global variable, used for a Virtual List, can contain anything, you can include all kinds of information. In one of my solutions I use a $$MENU global variable which uses a JSON array of menu values. Each menu item can contain any amount of information you want.
An example would be something like this.
{
"count" : 0,
"id" : "11B534CB-77C7-47BE-B5BE-72E001431B02",
"isFavorite" : "",
"languages" :
{
"en" : "Favorites",
"es" : "Favoritos"
},
"level" : 1,
"parameter" : "",
"parentid" : "",
"script" : "My script name here",
"state" : 0,
"tooltip" :
{
"en" : "List of your favorite menu items.",
"es" : "Lista de sus menús favoritos"
},
"visible" : 0
}
This then translates into a dynamic sidebar portal. Which, when a row is clicked, knows what script to run and supports all kinds of other features.
Using a calculated button bar within the virtual list portal you have a ton of UI options.
-- Matt Petrowsky - ISO FileMaker Magazine Editor
Virtual list in portal
One way I’ve used it is in a picker. If a user is presented with a long list of records to select, they will benefit by a separate list of the records selected. So, at the bottom of the picker card, I have a popover button that says “7 selected” and when they click that button I present a portal in a popover of the selected records. That portal is a virtual list driven by $$idsSelected.
Virtual list in portal
One way I’ve used it is in a picker. If a user is presented with a long list of records to select, they will benefit by a separate list of the records selected. So, at the bottom of the picker card, I have a popover button that says “7 selected” and when they click that button I present a portal in a popover of the selected records. That portal is a virtual list driven by $$idsSelected.
Multi key global
Remember, even with serial number primary keys, a multi key must be in a text field, because only text fields support lists.
Thanks!
Hey Matt, as always awesome content. I have to admit that this was one of the most straight forward explanations of a virtual value list I think I've ever seen. Most want to jump straight to the heavy weight stuff (incorporating multiple sort keys, JSON, ...).
I admittedly haven't used a lot of virtual value lists, but have a multitude of needs popping up. Crosstab reporting, menu systems, displaying large sets of data from multiple tables that need to be sorted....
Thank you! And any additional videos on virtual value lists incorporating JSON would be most appreciated... :-)
Alex