JSON_GET_FIELD_VALUES

Description

Returns a list containing the value of the specified field from each map in the provided list. Optionally excludes null values from the result.

Syntax

JSON_GET_FIELD_VALUES(json_array, field_name, exclude_nulls) -> List<ANY>

Parameters

ParameterData TypeRequiredDescription
json_arrayList<Map<String, ANY>>YesThe list of maps to extract values from.
field_nameStringYesThe name of the field whose value is extracted from each map.
exclude_nullsBooleanYesIf TRUE, maps whose field value is null or missing are omitted from the result. If FALSE, their values are included as null.

Examples

JSON_GET_FIELD_VALUES(VLOOKUP_ALL("Account", "Name, Industry, Phone", "OwnerId", OwnerId), "Name", true)
-- Returns the Name from every matching Account, e.g. (Acme, Global).
JSON_GET_FIELD_VALUES(VLOOKUP_ALL("Account", "Name, Industry, Phone", "OwnerId", OwnerId), "Phone", false)
-- Returns the Phone from every matching Account, keeping nulls, e.g. (null, (123)456-7890).

Related Formula