TreeINFO-For-M365 documentation
    Preparing search index...

    Basic class instance for working with a form field.

    Extends IBaseFieldService with form-specific properties and methods.

    It allows you to:

     * const { form } = tisa;
    * const { myField1, myField2 } = tisa.form.field;
    * if (form.isNewForm) {
    * // copy the value of field1 to field2 when it changes
    * myField1.onChange((value, { oldValue }) => {
    myField2.value = value;
    console.log(`${oldValue} -> ${value}`);
    });
    }

    Hierarchy (View Summary)

    Index

    Properties

    description: string

    Gets or sets the description of the field. The description is displayed below the input. If set, it overrides the default description coming from SharePoint. Supports resource keys with the RESX. prefix (e.g. "RESX.MyFieldDescription"). The key is resolved from the form's Resources translation table.

    const { form } = tisa;
    const { myField } = tisa.form.field;
    myField.description = "My Field Description";
    myField.description = "RESX.MyFieldDescription"; // resolved from Resources
    hidden: boolean

    Gets or sets whether the field is hidden.

    internalName: string

    Gets the internal name that is used for the field.

    originalValue: any

    Gets original field value before any changes. This value is not updated when the field value is changed.

    const { form } = tisa;
    const { myField } = tisa.form.field;
    console.log(myField.originalValue);
    readOnly: boolean

    Gets or sets whether the field is read-only.

    required: boolean

    Gets or sets whether the field requires a value.

    title: string

    Gets or sets the title (label) of the field. The title is displayed in the field header. If set, it overrides the default title coming from SharePoint. Supports resource keys with the RESX. prefix (e.g. "RESX.MyFieldTitle"). The key is resolved from the form's Resources translation table.

    const { form } = tisa;
    const { myField } = tisa.form.field;
    myField.title = "My Field";
    myField.title = "RESX.MyFieldTitle"; // resolved from Resources
    typeAsString: FieldType

    Gets the type of the field.

    const { form } = tisa;
    const { myField } = tisa.form.field;
    console.log(myField.typeAsString);
    value: any

    Gets or sets the field value.

    Methods

    • gets field property from tisaFields (TiSaProvider.tsx)

      Parameters

      • property: string

      Returns any

    • sets field property in tisaFields (TiSaProvider.tsx)

      Parameters

      • property: string
      • value: any

      Returns void

    • Sets a field value and waits for the value to be evaluated or rendered in the UI. Also allows disabling the onChange event trigger.

      Parameters

      • value: any

        the value to set

      • OptionaldisableTriggerOnChange: boolean

        when true, the onChange event is not raised

      Returns Promise<void>