preload
0 Comments | Sep 16, 2011

Merge Variables

Estimated Time To Read This: 2 minutes      


One of my favorite new features introduced back in FileMaker 8 was the inclusion of local and global variables. It cut down on the need to define extra fields for temporarily storing data in scripts (for example, storing the value of a primary key when creating a related record, keeping track of certain values when looping through records, etc). One of the things that I wished you could do, though, was display the contents of these fields on a layout; you still needed to create a field to do that.

You can do this now in FileMaker 11 thanks to Merge Variables. Merge variables work pretty much the same as merge fields (which have been in FileMaker for a long time), and in fact looks exactly the same – if you want to display the contents of the variable $$name on a layout, you would just use <<$$name>>. This feature is pretty handy; I most commonly use it in reports when I want to customize the text in the header, but there are a lot of possible uses (for example, changing the text of a label based on the contents of some field).

One thing to keep in mind if you plan to use this feature, is to make sure you’ve updated your version of FileMaker to at least FileMaker 11v2: the behaviour in the initial release would show the merge variable on the layout if no value was assigned to it (in the above example, if I hadn’t assigned a value to $$name it would appear as <<$$name>> on the screen in Browse mode).


Tags:, , , , , ,





Related Articles


Leave a Reply

* Required
** Your Email is never shared