1

Does anyone know how I can get the Guid or view the below list. The reason I ask is that I need to use the Guid for another lookup field, I need to specify this Guid as the source id.

enter image description here

I've tried the below code and the id that comes back from this does not appear to match the id of the sourceid of the field being created:

 private static void UserInfoListId() {
        try {
            using (ClientContext clientContext = new ClientContext(siteUrl)) {
                clientContext.Credentials = _credentials;
                Web web = clientContext.Web;
                List list = web.SiteUserInfoList;
                clientContext.Load(list);
                clientContext.ExecuteQuery();
                Console.WriteLine(list.Id);

            }
        } catch (Exception ex) {
            Console.WriteLine(ex.Message);
        }
    }
  • Do you want to get the GUID of User Information List i.e. hidden list of in SharePoint site collection? – users1100 Jul 16 '15 at 10:16
  • I've updated my question with code I have tried – Webfort Jul 16 '15 at 11:35
1

If you want to select persons, just use the PeoplePicker. It is in fact a lookup to that list.

Building your own lookup which is attached to that list will give you unpredictable results. The UserInformationList is a System list which contains all Users and Groups, which somehow did have relationships with that particular site (eg, accessing it, selected by a people-picker or assigned a permission to; in the end everywhere where SPWeb.EnsureUser() is called). The List contains SPUser-Objects (which usually represents AD-Objects namely ADUsers AND AD-Groups) and SPGroup Objects.

Regarding your question: I tried myself and in fact, what you did is right. The ID using resulting from your code IS the ID of the UserInformationList of that Site you are connected with. So the Problem is not the ID but it´s usage with your Lookup-Field.

  • Thanks, The reason I ask is relating to another question I have posted: sharepoint.stackexchange.com/questions/149162/… do you have any experience with this? – Webfort Jul 16 '15 at 12:42
  • If I have a Guid, can I get any more information from the Guid id, where the list is located or any other informtaion – Webfort Jul 16 '15 at 13:25
  • using the guid you can identify the List. You can use the guid also to get the corresponding list from the web´s listcollection – Leopold Lerch Jul 16 '15 at 18:52

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.