Person control
A richer people picker, surfaces user metadata (job title, department, manager) alongside the name.
The Person control is a heavier-weight alternative to the standard
User field. Autocomplete is identical, but a picked person renders with metadata pulled from Microsoft Graph, job title, department, manager, useful when the form needs context about who was selected.
Common properties
| Property | Description |
|---|---|
labelstring | Visible label. |
descriptionstring | Helper text. |
requiredboolean default: false | Marks the field required. |
readOnlyboolean default: false | Disables editing, the picked person is still shown. |
Type-specific properties
| Property | Description |
|---|---|
chooseFromType'peopleOnly' | 'peopleAndGroups' default: peopleAndGroups | Search scope, restrict to people only, or include AD/SharePoint groups. |
allowMultipleboolean default: false | Allow selecting more than one person/group. |
JavaScript recipes
Default to the current user
f365.events.onLoad(() => {
const me = f365.user.current();
if (!f365.field('Requestor').value) {
f365.field('Requestor').value = me;
}
});
Resolve a person by email and set the field
f365.events.onChange('AssignTo', async (email: string) => {
if (!email) return;
const user = await f365.user.byEmail(email);
if (user) f365.field('Owner').value = user;
});
Ensure a login is a site user before assigning
f365.events.onBeforeSave(async () => {
const user = await f365.user.ensureUser('i:0#.f|membership|jane@contoso.com');
if (user) f365.field('Approver').value = user;
});
Gate on group membership
f365.events.onBeforeSave(async () => {
const isManager = await f365.user.isInGroup('Managers');
if (!isManager) {
await f365.ui.showAlert('Only Managers can submit this form.');
return { cancel: true };
}
});
Related
Related articles
- User (People picker) field
Search and select one or more Microsoft 365 / Entra users via the People Picker, backed by SharePoint's User column.
- Lookup field
Search and pick from another SharePoint list, typeahead autocomplete with a configurable display column.