Gets metadata for items of an array and indicates the array type.
arrayGetMetadata(array)
returns struct
someArray.getMetadata()
Name | Type | Required | Default | Description |
---|---|---|---|---|
array | array | Yes | The array for which to get the metadata. |
// Create an array
arrayList = ["apple", "pineapple", "mango"];
// Fetch meta data
data = arrayGetMetadata(arrayList);
// Print array type
writeOutput(data.type);
// Create an array
arrayList = ["apple", "pineapple", "mango"];
// Fetch meta data
data = arrayList.getMetadata();
// Print array type
writeOutput(data.type);
CF2018+ Return struct has a new key called dimensions
and can also have a defined datatype. Supported datatypes are String, Numeric, Boolean, Date, Array, Struct, Query, Component, [Component name], Binary, and Function.
arr = arrayNew['String'](1);
writeOutput(serializeJson(arr.getMetadata()));