EXTRACT_VALUE
Description
EXTRACT_VALUE
is a row function that extracts the value for the given key from a string containing delimited key/value pairs.Syntax
EXTRACT_VALUE
(string
,key_name
[,delimiter
], [pair_delimiter
])Return Value
Returns the value of the specified key as type
TEXT
.Input Parameters
- string
- Required. A field of typeTEXTor literal string that contains a delimited list of key/value pairs.
- key_name
- Required. The key name for which to extract the value.
- delimiter
- Optional. The delimiter used between the key and the value. If not specified, the valueu0003is used. This is the Unicode escape sequence for thestart of textcharacter.
- pair_delimiter
- Optional. The delimiter used between key/value pairs when the input string contains more than one key/value pair. If not specified, the valueu0002is used. This is the Unicode escape sequence for theend of textcharacter.
Examples
Extract the value of the
lastname
key from a literal string of key/value pairs:EXTRACT_VALUE("firstname;daria|lastname;hutch", "lastname", ";", "|") returns
hutch
Extract the value of the
email
key from a Text
field named contact_info
that contains strings in the format of key:value,key:value
:EXTRACT_VALUE([contact_info], "email", ":", ",")