Site icon FileMakerHacks

Summary List As Relational Predicate, part 1

Disclaimer: This article features an undocumented technique. As with all material on this site, use at your own risk and test thoroughly.

One of my favorite features introduced in FM 13 is the summary list field type, which allows developers to easily access a list of field values for records in a found set.

The idea of using a summary list (indirectly, via a “helper field”) as a relational predicate is not new, and we explored it here on FileMaker Hacks last year:

At the time I wrote, “Unfortunately we can’t use a summary field as a relational predicate, so let’s define a calculated field with a text result, to echo the summary list field.”

Well it turns out I was wrong. I happened to repeat the above remark to Dr. Ray Cologon the other day, and he astonished me by replying, “Actually, it is possible to use a summary field as a relational predicate,” and then left me to ponder how one might accomplish this.

Hmmm. If you’ve ever tried to assign a summary field as a relational predicate…

…you’ve seen that it’s greyed out and FileMaker will not allow you to select it.

But what if you were to instead…

Know what? It works like a charm.

I asked Dr. Ray if that was the approach he had in mind, and he replied:

Yep, that’s the procedure… a List summary field will then operate as a multi-key without the need for an ‘intervening’ calc.

And since the intervening calc is required to be unstored it chews up processor cycles, so directly connecting the summary field removes one step in what is otherwise a bucket brigade of sorts – meaning that it runs at about double the speed.

I’ve been using the technique since the day v13 was released, but was initially cautious — as I always am — in relation to anything that could be considered an undocumented feature.

However, while nothing is certain, I think this one is a reasonably safe bet. Internally, List summary fields return their result data typed as text, and it seems reasonable to expect they will continue to do so – and that’s really all that’s required to achieve the effect in this case (along with the ‘trick’ of setting it up that way…).

Exit mobile version