externalize( value )
Converts the given value to a string representation so that it can be saved externally. The externalized string must only be used in conjunction with internalize()
and must be internalized on the same server. Moreover, the type id of the value is embedded in the externalized string.
See also: internalize()
Keyword | Type | Description |
---|---|---|
|
Any Type |
Value to externalize. |
Text
The returned value can later be converted back to the original value using internalize(). For example, the text returned by externalize(pv!myUserPv)
could be stored in an external database and later assigned back to a user PV by passing the externalized representation of the value to internalize()
.
This function cannot be used with record data. Instead, you can use a!toJson() to create a text representation of record data to be stored outside Appian. The JSON can then be cast to a record data type with a!fromJson().
This example shows how to cast a JSON string to the Address record type. When casting JSON data to a record type, Appian automatically matches the keys to the record type's fields. Any non-matching key names are ignored.
1
2
3
4
5
6
7
cast(
recordType!Address,
a!fromJson(
"{""addressId"":301,""addressLine"":""7950 Jones Branch Dr"",
""city"":""McLean"",""stateProvinceId"":75,""postalCode"":""22102""}"
)
)
externalize(!pv2)
returns 0100000020000000000000000200000004000000 75736572330000017C36F9010100000004000000
where !pv2
is User Mike Smith
with a username of user3
Feature | Compatibility | Note |
---|---|---|
Portals | Compatible | |
Offline Mobile | Compatible | |
Sync-Time Custom Record Fields | Compatible | Can be used to create a custom record field that only evaluates at sync time. |
Real-Time Custom Record Fields | Incompatible | |
Process Reports | Compatible | |
Process Events | Compatible |
externalize() Function