GetFieldValues

Gets an array of values from the specified field.

Parameters

Name Type Description
fieldName String The name of the field.
defaultValue (optional) String The default value or array of values to return if the field does not exist on the form, if it is not found, or if its value is empty. If this parameter is not provided, "null" is returned.
Note: If the defaultValue is a single string value, it is converted to a single-element array.

Return Value

Result Value
Success An array of strings, dates, or numbers matching the field type.
Failure Null or the default value

Examples

This example returns the array value of the field:

GetFieldValues("Reviewers");
This example returns a default array of values:
GetFieldValues("Reviewers", ["Tom Smith", "Susan Jones"]);

Comments

GetFieldValues is typically used with Multi-Group, Multi-Relational, Multi-Selection, and Multi-User fields. If this method is used with other field types, it returns an array with a single value.