Save Variable Data
This action saves values of a single or multiple variables in an associated data file.
In Loftware Automation module, this action allows data exchange between triggers. To read the data back into the trigger, use action Load Variable Data.
Tip
The values are saved in a CSV file with the first line containing variable names. If the variables contain multi-line values, the newline characters (CR/LF) are encoded as \n\r.
About group identifies the selected action.
- Name: allows you to define a custom action name. This makes actions easily recognizable on the solution's list of actions. By default, the action name is taken from its type.
- Description: custom information about the action. Enter a description to explain the purpose and role of action in a solution.
- Action type: read-only information about the selected action type.
Settings group defines the file name.
-
File name: data file to save the variable data to. If the name is hard-coded, values are saved into the same data file each time.
Use UNC syntax for network resources. For more information, see section Access to Network Shared Resources in Loftware Automation user guide.
If file exists group offers additional options to save the values.
-
Overwrite the file: overwrites the existing data with new variable data. The old content is lost.
-
Append data to the file: appends the variable values to the existing data files.
File Structure group defines the CSV variable data file parameters:
-
Delimiter: specifies the delimiter type (tab, semicolon, comma or custom character). Delimiter is a character that separates the stored variable values.
-
Text qualifier: specifies the character that qualifies the stored content as text.
-
File encoding: specifies character encoding type to be used in the data file. Auto defines the encoding automatically. If required, the preferred encoding type can be selected from the drop-down list.
Tip
UTF-8 makes a good default selection.
-
Add names of variable in the first row: places the variable name in the first row of the file.
Variables group defines the variables whose value should be read from the data file. Values of the existing variables are overwritten with values from the file.
-
All variables: variable data of all variables from the data file is read.
-
Selected variables: variable data of listed variables is red from the data file.
Action Execution and Error Handling
Each action can be set as a conditional action. Conditional actions only run when the defined conditions allow them to be run. To define these conditions, click Show execution and error handling options.
Execution options are:
- Enabled: specifies if the action is enabled or disabled. Only enabled actions will execute. This functionality may be used while testing a form.
- Condition: defines one-line programming expression that must provide a Boolean value (true or false). When the result of the expression is true, the action will execute. Condition offers a way to avoid executing actions every time.
Error handling options are:
- Ignore failure: specifies whether an error should be ignored. If enabled, the execution of actions continues even if the current action fails.
Note
Nested actions that depend on the current action do not execute in case of a failure. The execution of actions continues with the next action on the same level as the current action. The error is logged but does not break the execution of the action.
- Save error to variable: allows you to select or create a variable to save the error to. The same cause of the error is also saved to internal variables ActionLastErrorId and ActionLastErrorDesc.
At the end of printing, you might want to send the status update to an external application using the HTTP Request action. If the printing action fails, action processing stops. In order to execute the reporting even after the failed print action, the Print Label action must have the option Ignore failure enabled.