SBM JavaScript Library Guide → Reference → Field Methods → GetFieldValues
Gets an array of values from the specified field.
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.
|
Result | Value |
---|---|
Success | An array of strings, dates, or numbers matching the field type. |
Failure | Null or the default value |
This example returns the array value of the field:
GetFieldValues("Reviewers");
GetFieldValues("Reviewers", ["Tom Smith", "Susan Jones"]);
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.
Copyright © 2007–2016 Serena Software, Inc. All rights reserved.