I need to retrieve some information from a FieldLookupValue using CSOM SharePoint2013 library. Specifically, I have a SPList and I need to populate a Field which type is Lookup. Is there a way to know the name of associated list? I know for sure that this information is contained in the FieldLookupvalue: if I create an instance of it using LookupID of associated Item SharePoint automatically associates the lists. Infact this code works well:
switch (field.TypeAsString)
{
case "Lookup":
int id = Convert.ToInt32(info);
FieldLookupValue lv = new FieldLookupValue() { LookupId = id };
newItem[field.InternalName] = lv;
break;
default:
// do nothing
break;
}
FieldLookupValue class does not expose any properties for getting associated list, but you could retrieve the associated list from a Lookup field
The following example demonstrates how to retrieve associated List for
Predecessors
field fromTasks
list: