Hi Luke,
Yes, it is possible to get the unique values of a field, but the way to do so isn't obvious.
As Colin pointed out, the key is to use the Table.CalculateStatistics() routine. This will allow you to generate statistics on one or more fields and includes the ability to execute a group by on these statistics. To get the unique values, you execute this code, passing in a "dummy" statistic to calculate.
In the example below, I build a list of unique values for the SUB_REGION field of a States table.
// Get field for Region
Field regionField = featureClassDefinition.GetFields().First(x => x.Name.Equals("SUB_REGION"));
// Create a "fake" StatisticsDescription object
StatisticsDescription statisticsDescription = new StatisticsDescription(regionField, new List<StatisticsFunction>() { StatisticsFunction.Count });
// Create a TableStatisticsDescription that will return unique Region values (and a
// count of how many rows have that value)
TableStatisticsDescription tableStatisticsDescription = new TableStatisticsDescription(new List<StatisticsDescription>() { statisticsDescription });
tableStatisticsDescription.GroupBy = new List<Field>(){ regionField };
// Generate the statistics (and list of unique values)
IReadOnlyList<TableStatisticsResult> results = statesFeatureClass.CalculateStatistics(tableStatisticsDescription);
// Table.CalculateStatistics() returns one TableStatisticsResult object for each unique
// GroupBy tuple.
// If you pass one field into the TableStatisticsDescription.GroupBy object, you'll get
// one TableStatisticsResult object for each unique value of that field
foreach(TableStatisticsResult result in results)
{
// TableStatisticsResult.GroupBy returns one KeyValuePair<Field,object> for each field
// in the TableStatisticsDescription.GroupBy list
// If you only pass one field into that list, we only get one
// KeyValuePair<Field,object>
KeyValuePair<Field, object> groupByPair = result.GroupBy.First();
// groupByPair.Field is the Field you passed into TableStatisticsDescription.GroupBy
// groupByPair.Value is a unique value of that field
string myFieldValue = (string) groupByPair.Value;
Console.WriteLine(myFieldValue);
}
We'll take a look at providing a more obvious way this to do in a future version of ArcGIS Pro.
Let me know if this helps,
--Rich