The esri_attributes_uniquevalues function returns a list of the unique values for a specified field.
Syntax
(esri_attributes_uniquevalues flname subtype field)
Arguments
- flname | string | required | An existing feature layer name in the drawing.
- subtype | string | required | An existing subtype feature layer name in the drawing. Use an empty string "" for no subtype.
- field | string | required | An existing field name from the feature layer.
Example usage
Request the unique values from the SUB_REGION field of the USA_States_GENERALIZED (no subtype) feature layer: (esri_attributes_uniquevalues "USA_States_GENERALIZED" "" "SUB_REGION")
Result example usage
Return a simple list of unique field values of the specified SUB_REGION field name:
("East North Central" "South Atlantic" "New England" "East South Central" "Middle Atlantic" "Mountain" "West South Central" "West North Central" "Pacific")Return values
The following are the possible return values:
- If successful, the function returns a simple list of unique field values of the same type as the specified field type
- If failed, it returns a list with the first value of nil; then, an associated list is returned containing the key value "Error" and an associated error message as a string: (nil ( "Error" . "<message>")).
Failed returned values
A failed return value can occur for any of the following reasons:
- (nil ("Error" . "Missing required
argument."))
One or more of the required arguments was not provided.
- (nil ("Error" . "Feature layer not found."))
The specified feature layer does not exist in the file.