GetPersistentData
Returns the persistent data value specified by name and instance ID.
Format
GetPersistentData ( name ; instanceID )
Parameters
name - a text expression that specifies the name of the persistent data entry.
instanceID - a text expression that identifies the specific instance of the entry. Must match the instance ID used when storing the data. Can be an empty string ("").
Data type returned
text, number, date, time, timestamp, container
Originated in version
26.0
Description
This function retrieves a value from the persistent data store by name and instance ID. The data type of the returned value matches the data type that was stored. See About the persistent data store.
If no entry exists with the specified name and instance ID, this function returns "?".
Notes
-
Use ListPersistentDataIDs function to find all instance IDs for a given name.
-
If you specify
instanceIDas an empty string (""), this function looks for an entry with an empty instance ID.
Example 1
GetPersistentData ( "AppVersion" ; "" ) returns 2.1.0 if AppVersion was set with no instance ID as in Example 1 for the Configure Persistent Data script step.
Example 2
Returns the specified entry or an empty JSON object as a default value when the specified entry isn't found.
Let (
config = GetPersistentData ( "com.claris.myaddon.settings" ; "38EA3124-9CFD-4490-A634-A0A72A613145" ) ;
If ( config = "?" ; JSONSetElement ( "" ; "" ; "" ; JSONObject ) ; config )
)
Example 3
When setting the URL for a web viewer, retrieves a JavaScript library from the persistent data store. This approach keeps large JavaScript code out of your calculation formulas and makes it easier to update.
Set Web Viewer [ Object Name: "webviewer" ; URL:
"data:text/html," &
"<html><head><script>" &
GetPersistentData ( "ChartLibrary" ; "SharedLibraries" ) &
"</script></head>" &
"<body><div id='chart'></div>" &
"</body></html>"
]