Skip to main content
Skip table of contents

storeString

Stores a variable value into a document or another kind of File. This stored value can be later restored with restoreString or restoreStringSet.

If you wish to store several values, instead of several storeString commands you may be able to make use of storeStringSet instead to reduce the command count.

Attributes

key

Required

Value type

EL-evaluated

Yes

String

Yes

Defines the name given to the stored String in the File. When this stored String is restored with restoreString, its key value has to match this command's key value.

value

Required

Value type

EL-evaluated

Yes

Any

Yes

The resolved value of this attribute is the value stored. If the format is defined, this value is formatted before being stored, otherwise it is stored as is. 

format

Required

Value type

EL-evaluated

No

String

No

Defining a value for this attribute causes the stored String to be formatted into a different kind of value before being stored. Matching this format with restoreString's parser allows more complex variable values besides Strings to be stored and restored back into values of their original kinds.

The following values maybe used:

  • "json"
    The value is formatted into JSON. This allows various kinds of non-String values, such as Collections and Maps, to stored and restored successfully.  

  • "file"
    The value is base64-encoded. This allows File values to be stored and restored successfully.

  • Name of a Format
    The value is formatted with the named Format.

If left undefined, the value is converted into a String if it isn't one already and stored.

storeTo

Required

Value type

EL-evaluated

No

File

Yes

The resolved File is where the value is stored. The File may be an Online template, an Office template or a PDF document.

If this attribute is not defined, the value is stored into the Online template or Office template in which this command exists in. 

Examples

The storeString and restoreString commands are most commonly used to have a PDF file produced by the logic to act as a storage for data related to the life cycle of whatever process the PDF is part of. In this model storeString stores something into the PDF, such as selection the user did during the Flow. The PDF is then saved somewhere where the Flow can find it on the next run.

CODE
<storeString key="selectedAttachment" value="${selectedAttachmentId}" storeTo="${exportedPDF}">

When the Flow is run again, it finds the PDF and restoreString reads the selection from it, allowing the logic to make use of this data, such as have the past selection to be pre-selected on a Screen.

CODE
<restoreString var="selectedAttachmentId" key="selectedAttachment" readFrom="${existingPDF}">
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.