Gets or sets the description of the field. The description is displayed in the field header. If set, it overrides the default description in SharePoint for the field.
Gets or sets a value that specifies whether the field is hidden on form. If the field is hidden, the field is not displayed on the form, but can be accessed programmatically.
ReadonlyinternalGets the internal name that is used for the field.
ReadonlyoriginalGets original field value before any changes. This value is not updated when the field value is changed.
Gets or sets a value that specifies whether the field requires a value. If the field is required, the value of the field must be set before the form can be saved.
Gets or sets the title of the field. The title is displayed in the field header. If set, it overrides the default title in SharePoint for the field.
ReadonlytypeGets or sets the user(s) by Id. User(s) can be set also by native SharePoint field value format or ISiteUserInfo object. User returns ISiteUserInfo object or ISiteUserInfo object array, if multiple on field is supported. For setting user(s) by login name (UPN or claim token), use the setValue method.
// usage in onInitComplete event (allow synchronous operations with user field)
const { form } = tisa;
const { myField } = tisa.form.field;
// get user field value
const value = myField.value;
console.log(value);
// set single user by Id
myField.value = 1;
// set single user by User object
myField.value = { Id: 1, LoginName: "user1@example.com", Title: "Name of User 1" };
// set single user by native SharePoint field value format
myField.value = "1#;Name of User 1";
// set multiple users by Id
myField.value = [1, 2, 3];
// set multiple users by User objects
myField.value = [{ Id: 1, LoginName: "user1@example.com", Title: "Name of User 1" }, { Id: 2, LoginName: "user2@example.com", Title: "Name of User 2" }, { Id: 3, LoginName: "user3@example.com", Title: "Name of User 3" }];
// set multiple users by native SharePoint field value format
myField.value = ["1#;Name of User 1", "2#;Name of User 2", "3#;Name of User 3"];
// clear user field value
myField.value = null;
myField.value = [];
// reset user field value to original value
myField.value = myField.originalValue;
// usage in onInit event (only asynchronous operations with user field are allowed)
const { form } = tisa;
const { myField } = tisa.form.field;
// get user field value
const value = await myField.value;
console.log(value);
// set single user by login name (upn or claim token)
await myField.setValue("john.doe@example.com");
const newValue = await myField.value;
console.log(newValue);
Sets a field value and waits for the value to be evaluated or rendered in the UI.
Also allows disabling the trigger onChange event.
the value you want to set in the field
OptionaldisableTriggerChange: boolean(optional) disables the onChange event from being raised on the field
The event is triggered whenever the field value changes. The event can be suppressed by calling the setValue method
with the disableTriggerOnChange parameter set to true.
function callback on event fired
The user field type is used to display a user or a list of users on a SharePoint item.
Inherits core field functionality from Field, including:
Example