Hi all,
I need to list all distinct values stored in an Item property, in the same way one do in SQL with SELECT DISTINCT myfield FROM mytable
I know I could get all items with
itmSvc.GetAllLatestItems()
and then cycle trough the array and using
itmSvc.GetItemProperties(New Long() {itm.Id}, New Long() {MyPropDefId})
get the value of the property and finally collecting all the values, taking each value only one time, but I'm wondering, isn't there a better way?
Thanks
Nicola
Well
I optimized my code building an array with all my item ids, and calling itmSvc.GetItemProperties only one time.
Now it runs really faster, but I think there should be an API to do this, simply I didn't find it.
Thanks
Nicola
Thanks for your post!
Your second way is rigth. There is not a API to get distinct values for a property.
For properties where the user can input any value, there is no way to get distinct values.
However, if the property requires the user to select from a list, you can get that list using GetPropertyDefinitionInfosByEntityClassId in the PropertyService. I'm not sure if that helps or not.
Sorry if i resume this old post, but i need a method to retrieve che distinct value of a file property. In particular i need to know all distinct file extensions stored in Vault.
I have Vault SDK 2013 API.
Sorry, but no such API exists.
-Dave