Configure Persistent Data

Sets or deletes an entry in the persistent data store.

Options 

  • Name is text that specifies the name of the persistent data entry. The name can't be empty.

  • Instance ID is an optional text expression that you can use to identify the specific instance of the entry. Multiple entries can have the same name with different instance IDs.

  • Value is an expression for the data to store. The data type is preserved when the value is stored.

  • Delete Entry deletes the specified entry.

Compatibility 

Product Supported
FileMaker Pro Yes
FileMaker Go Yes
FileMaker WebDirect Yes
FileMaker Server Yes
FileMaker Cloud Yes
FileMaker Data API Yes
Custom Web Publishing Yes

Originated in version 

26.0

Description 

If an entry with the specified name and instance ID already exists, this script step updates its value or deletes the entry, depending on whether Value or Delete Entry is selected. If the entry doesn't exist, specifying Value creates the entry. See About the persistent data store.

Notes 

  • To retrieve the value of an entry, use the GetPersistentData function.

  • Because the size of a calculation formula is limited (see FileMaker Pro technical limits), you can't enter a text value that exceeds that limit in the Value option. To specify text values larger than this limit, reference a field or variable that contains the data for the Value option. To get text into a field or variable first, you can use script steps such as Insert Text (for text stored in the script step itself), Insert from URL (for text available via a URL), or Read from Data File (for text in a local file).

  • Instance ID can be unspecified (blank) or an empty string ("").

  • An unspecified (blank) Instance ID is treated the same as an empty string ("").

  • Deleting an entry that doesn't exist returns error code 10 ("Requested data is missing").

Example 1 

Stores a simple version number to an entry named AppVersion (with no instance ID) in the current file's persistent data store.

Copy
Configure Persistent Data [ AppVersion ; Value: "2.1.0" ]

To read this entry, see Example 1 for the GetPersistentData function.

Example 2 

Stores multiple configuration values for an add-on using the add-on's instance ID.

Copy
Set Variable [ $instanceID ; Value: "38EA3124-9CFD-4490-A634-A0A72A613145" ]
Configure Persistent Data [ com.claris.myaddon.theme ; Instance ID: $instanceID ; Value: "Dark" ]
Configure Persistent Data [ com.claris.myaddon.language ; Instance ID: $instanceID ; Value: "en" ]
Configure Persistent Data [ com.claris.myaddon.modificationdate ; Instance ID: $instanceID ; Value: Get ( CurrentTimestamp ) ]

Example 3 

Deletes a specific persistent data entry by name and instance ID.

Copy
Set Variable [ $instanceID ; Value: "38EA3124-9CFD-4490-A634-A0A72A613145" ]
Configure Persistent Data [ com.claris.myaddon.theme ; Instance ID: $instanceID ; Delete ]