FunctionCopy link to clipboard
a!save( target, value )
In interface saveInto parameters, updates the target with the given value. Use a!save for each item that you want to modify or alter in a saveInto
parameter. This function has no effect when called outside of a component's saveInto parameter.
ParametersCopy link to clipboard
Keyword | Type | Description |
---|---|---|
|
List of Save |
A local variable, rule input, process variable, or node input in which to save the value. Local variables that refresh on an interval using "refreshInterval" or on every evaluation, either because they are using "refreshAlways" or because they are defined in the |
|
Any Type |
The value to save. The component's updated value can be accessed using the special variable |
ReturnsCopy link to clipboard
Save
Usage considerationsCopy link to clipboard
a!save()
can be called multiple times for a given component by passing them in a list to the component's saveInto parameter.
If the component's updated value should be saved directly into a variable without modification, the a!save()
function is not necessary (see first example below).
Using a value parameterCopy link to clipboard
The target and value parameters are not evaluated until the user interacts with the component.
The variable save!value
is only available in the value parameter of a!save()
. It cannot be used in the target parameter or outside of a!save()
.
If the component's updated value should be saved directly into a variable without modification, the a!save()
function is not necessary (see first example below).
a!save()
can be used in conjunction with a rule input of type Save to create reusable custom components.
ExamplesCopy link to clipboard
To experiment with examples, copy and paste the expression into an interface object.
Saving a variable without modification (doesn't need a!save function)Copy link to clipboard
1
2
3
4
5
6
7
=a!localVariables(
local!text,
a!textField(
value: local!text,
saveInto: local!text
)
)
Copy
Upper-casing the typed textCopy link to clipboard
1
2
3
4
5
6
7
=a!localVariables(
local!text,
a!textField(
value: local!text,
saveInto: a!save(local!text, upper(save!value))
)
)
Copy
Upper-casing and appending to the typed textCopy link to clipboard
1
2
3
4
5
6
7
=a!localVariables(
local!text,
a!textField(
value: local!text,
saveInto: a!save(local!text, "You just typed: " & upper(save!value))
)
)
Copy
Upper-casing and appending to the typed text in one variable, saving unchanged to anotherCopy link to clipboard
1
2
3
4
5
6
7
8
9
10
11
12
=a!localVariables(
local!modifiedText,
local!unmodifiedText,
a!textField(
instructions: local!modifiedtext,
value: local!unmodifiedText,
saveInto: {
a!save(local!modifiedtext, "You just typed: " & upper(save!value)),
local!unmodifiedText
}
)
)
Copy
Modifying two variables based on the same typed textCopy link to clipboard
1
2
3
4
5
6
7
8
9
10
11
12
=a!localVariables(
local!upperCaseText,
local!appendedText,
a!textField(
value: local!upperCaseText,
instructions: local!appendedText,
saveInto: {
a!save(local!upperCaseText, upper(save!value)),
a!save(local!appendedText, "You just typed: " & save!value)
}
)
)
Copy
Modifying two variables, one based on the typed text and one with an arbitrary valueCopy link to clipboard
1
2
3
4
5
6
7
8
9
10
11
12
=a!localVariables(
local!upperCaseText,
local!isModified: false,
a!textField(
value: local!upperCaseText,
instructions: if(local!isModified, "Modified", ""),
saveInto: {
a!save(local!upperCaseText, upper(save!value)),
a!save(local!isModified, true)
}
)
)
Copy
Modifying two variables, one based on the typed text and one conditionallyCopy link to clipboard
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
=a!localVariables(
local!text,
local!longText: "Short Text",
local!shortText: "Long Text",
a!textField(
label: local!shortText,
instructions: local!longText,
value: local!text,
saveInto: {
local!text,
a!save(
if(
len(local!text) > 5,
local!longText,
local!shortText
),
save!value
)
}
)
)
Copy
Feature compatibilityCopy link to clipboard
The table below lists this function's compatibility with various features in Appian.
Feature | Compatibility | Note |
---|---|---|
Portals | Compatible | |
Offline Mobile | Compatible | |
Sync-Time Custom Record Fields | Incompatible | |
Real-Time Custom Record Fields | Incompatible | Custom record fields that evaluate in real time must be configured using one or more Custom Field functions. |
Process Reports | Incompatible | Cannot be used to configure a process report. |
Process Events | Incompatible | Cannot be used to configure a process event node, such as a start event or timer event. |