How to get People Peacker data in SharePoint by JavaScript

This is my very brierf memo about how to get People Peacker data in SharePoint by JavaScript.

Example of field:

Field with people pecker type can be multiple-choice. You can handle this in code.

Example of code (with using JQuery) for retrieving user data from this type of field. In my case I’ll get internal SharePoint user claim value:

let peoplePickerField = $("#peoplePickerField")[0]
let peoplePicker = SPClientPeoplePicker.SPClientPeoplePickerDict[];
let users = peoplePicker.GetAllUserInfo();
let user = users[0];
let userClaim = user.Key;

As i said this is very little memo for me and you if you’ll found this article useful.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *