« LibXL 5.2 released | Home | MBS FileMaker Plugin,… »

Playing with Persistent Data in FileMaker 26

Today we try the new Persistent Data functions in FileMaker 26. A way to have per file global and persistent values. Use cases involve:

  • Storing XML, JSON, JavaScript, HTML or any other large data block in the structure.
  • Storing template PDF or images for logos
  • Storing preferences in the file like window position. Then use Get(AccountName) or user id as instance ID.
  • Storing data instead of a global variable.

This is not meant to store secure data like oauth keys. Everyone could potentially read the values and they are included in migration and with Save as XML!

Since every write causes a write to a file, it is a bit slower than a global variable. And this doesn't take part in transactions, so you may not want to write this together with multiple values to make sure they are either all written or none. This looks more like write once (or rarely) and read a lot.

Key can't be variable

If I do this

Configure Persistent Data [ $key ; Instance ID: $instanceID ; Value: 123 ]

The persistent data is stored with a key named $key. The variable is not resolved.

Same as when I put in "key":

Configure Persistent Data [ "key"; Instance ID: $instanceID ; Value: 123 ]

Where the persistent data got the name "key" with the quotes! You can see that when saving as XML.

So the key must be given directly without quotes and variable:

Configure Persistent Data [ key ; Instance ID: $instanceID ; Value: 123 ]

But the instanceID can be a variable.

For GetPersistentData we can use "key" to pass the name and it works:

GetPersistentData ( "key"; $instanceID)

Checking data type

I had to try whether the data types are preserved as noted in the documentation:

Set Variable [ $value ; Value: "hello" ]
Set Variable [ $instanceID ; Value: "" ]
Set Variable [ $key ; Value: "key" ]
Configure Persistent Data [ key ; Instance ID: $instanceID ; Delete ]
Configure Persistent Data [ key ; Instance ID: $instanceID ; Value: $value ]
Set Variable [ $read ; Value: GetPersistentData ( $key; $instanceID) ]
Show Custom Dialog [ "Data Types" ; MBS("FM.DataType"; $value) & " -> " 
	& MBS("FM.DataType"; $read) & ¶ & $read ]

When trying this, we get numbers, times, dates, timestamps, texts and containers store just fine. No need to Base64 encode the containers!

Listing the instances

You can list the instances with the ListPersistentDataIDs() function and pass the keys.

ListPersistentDataIDs ( "key" )
ListPersistentDataIDs ( "$key" )
ListPersistentDataIDs ( "\"key\"" )

I can see the instances I made on the way above. We have entries with $key as name. Not the value in the variable, but the variable name.

Trying on server

The server allows us to write the persistent data on one machine and read on the other. You ever dreamed of shared storage over multiple machines beside fields? Here you get it. When you store a persistent data, this triggers the SchemaChange functions.

On the server, we get this log entries:

accountcatalogcounterfileidtimeuser
Adminpersistent store17Assets.fmp12206/13/2026 11:34:43 AMChristian Schmitz
Adminpersistent store18Assets.fmp1206/13/2026 11:34:43 AMChristian Schmitz
Adminpersistent store19Assets.fmp1206/13/2026 11:34:43 AMChristian Schmitz

Here we learn the internal ID for the new persistent data. The number showing up is the running number to count up the persistent data. The next one will get 3 in our example file. Otherwise we don't see details like a key.

Save as XML

We can save the file as XML and see the PersistentStore entries:

<PersistentStore name="test" instanceID="1234" id="1">
	<UUID modifications="1" userName="Christian Schmitz" accountName="Admin" 
		timestamp="2026-06-13T11:34:02">F2DA75FD-1933-4910-BF60-CA58F44EB065</UUID>
	<Value type="Text">
		<StyledText>
			<Data><![CDATA[Hello]]></Data>
		</StyledText>
	</Value>
</PersistentStore>

Please note that the export here always shows StyledText. We stored 123 there, we could read it as number, but the export shows StyledText. e.g. a date shows as <StyledText><Data><![CDATA[06/13/2026]]></Data></StyledText> .

Older FileMaker

If you open the FileMaker database with Persistent Data in an older FileMaker version, the older version will ignore the extra catalog. Still all operations that copy all catalogs will carry the Persistent Data over. For example saving a copy of the file, a compact copy or a clone in FileMaker 22 will carry over the Persistent Data into the new file. That's great as we don't loose our Persistent Data if we accidentally open the file in the old version or some clients connect with an older version to the server.

15 06 26 - 07:35