0

i have a list with a field (Customers) of people and group type with multiselection set to true i want to fetch the IEnumerable list of ids from that field as that field contains value in the format somewhat like (3;#;username)

1

You can iterate through the SPFieldUserValueCollection and obtain the id value like so:

SPFieldUserValueCollection collection = new SPFieldUserValueCollection(web, listItem["Customers"]);
foreach (SPFieldUserValue value in collection)
{
    value = value.LookupId
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.