Getting only first value of multi value string in User Profile Property
-
06-12-2019 - |
Frage
I defined a multi value string for user profile properties in the backend of my SharePoint 2010. I'm reading the content from the created property like this:
propertyValue = profile[propname].Value.ToString();
unfortunately i'm getting only the first stored value of the multi value field.
profile in the code is of type UserProfile and has GetUserProfile(accountName) from the UserProfileManager in it
Any Ideas how to get all multi values?
Lösung
The profile property is actually a UserProfileValueCollection
.
e.g.
UserProfileValueCollection propertyCollection = profile[propname];
foreach(var prop in propertyCollection)
{
Console.WriteLine(prop.ToString());
}
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit sharepoint.stackexchange