How to expand IFieldUserValue.Principal #770
-
Hey, how could I retrieve the Principal field of a IFieldUserValue object? It was retrieved from the IListItem.Values collection. I need it to check if this value is a Group or a User. I know that I can retrieve a ISharePointUser instance for a group and also a user via context.Web.GetUserByIdAsync. But I'm asking if there is a way to get that information without that? Or maybe getting the AadObjectId without a extra load/call to AsGraphUserAsync()? Kind Regards |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
@LegendaryB : probably the most effective approach is to read the |
Beta Was this translation helpful? Give feedback.
@LegendaryB : probably the most effective approach is to read the
IWeb
propertiesSiteUsers
andSiteGroups
once and then lookup the ids from there. Or alternatively read the "User Information List" which you can get via theIWeb
SiteUserInfoList
property. Key will be to read this data once and then use for all the individual list items you want to check.