mardi 4 juillet 2017

Get PeoplePicker object from SharePoint list

I already managed to store a PeoplePicker object inside my Sharepoint list. But whenever I try to load it from the List into a PeoplePicker input field using JavaScript it doesn't load all of the object values.

I tried this

var person = target.get_item("PersonField").get_lookupValue();

which obviously just returns the DisplayName. But thats not enough - multiple entries are possible to be found when searching just by display names and therefore detected by the PeoplePicker field as an error. However, this version

var user = target.get_item("PersonField");

does return an object, although it contains the DisplayName, an ID and some other random data. In my case, all that matters is the Key-Attribute ("i:0#.w|comp\xxxxx"), which is neither inside the first version variable nor the second version variable.

Any help is appreciated!




Aucun commentaire:

Enregistrer un commentaire