Skip to content

Data Storage

Save widget data and restore it in future sessions from Flow Pro scripts.

Updated View as Markdown
For humans
Flow APIFlow Pro scriptingScripts and storage

This article covers the following platforms

Each widget can save its own data and restore it in future sessions.

export()

Persist a serializable object for the current widget.

SignatureTypeScript contract
export(data: Record<string, unknown>): void

Parameters

NameTypeRequiredDescription
dataRecord<string, unknown>YesObject to persist. Flow stringifies it before storage.
ExampleJavaScript
this.$api.datastore.export({ preferredView: "compact" });

Returns

voidNo direct return value is documented.

import()

Merge stored widget data into a supplied default object.

SignatureTypeScript contract
import(store: Record<string, unknown>): Record<string, unknown>

Parameters

NameTypeRequiredDescription
storeRecord<string, unknown>YesDefault object to merge with the stored data.
ExampleJavaScript
const settings = this.$api.datastore.import({ preferredView: "expanded" });
console.log(settings);

Returns

Record<string, unknown>A copy of the supplied object merged with the stored widget data.
Navigation

Type to search…

↑↓ navigate↵ selectEsc close