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

    The ExternalLookup field type is used to display a list of items from a SharePoint list or external data source.

    const { form } = tisa;
    const { myField } = tisa.form.field;
    myField.value = "1#;Value1";

    Hierarchy (View Summary)

    Implements

    Index

    Properties

    description: string

    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.

    const { form } tisa;
    const { myField } tisa.form;
    myField.description = "My Field Description";
    hidden: boolean

    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.

    const { form } tisa;
    const { myField } tisa.form;
    myField.hidden = true;
    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;
    console.log(myField.originalValue);
    readOnly: boolean

    Gets or sets a value that specifies whether the value of the field is read-only. If the field is read-only, the value of the field cannot be changed in the UI, but can be changed programmatically using the value property or the setValue method.

    const { form } tisa;
    const { myField } tisa.form;
    myField.readOnly = true;
    required: boolean

    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.

    const { form } tisa;
    const { myField } tisa.form;
    myField.required = true;
    title: string

    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.

    const { form } tisa;
    const { myField } tisa.form;
    myField.title = "My Field";
    typeAsString: FieldType

    Gets the type of the field.

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

    Gets or sets the value of the field. Optionally, the setValue method can be used for advanced setting value. If value is set, the onChange event is triggered.

    const { form } tisa;
    const { myField } tisa.form;
    myField.value = "My Value";

    Methods

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

      Parameters

      • value: any

        the value you want to set in the field

      • OptionaldisableTriggerOnChange: boolean

        (optional) disables the onChange event from being raised on the field

      Returns Promise<any>

      const { form } tisa;
      const { myField } tisa.form;
      // sets a field value and waits for the value to be evaluated or rendered in the UI
      await myField.setValue(1);
      // sets a field value and does not trigger the OnChange event
      await myField.setValue(1, true);

    Events

    • 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.

      Parameters

      Returns void

      const { form } tisa;
      const { myField1, myField2 } tisa.form;
      // copies the value of field1 when changed to field2 and logs the old and new values
      myField1.onChange((value, { oldValue })=>{
      myField2.value = value;
      console.log(`${oldValue} -> ${value}`);
      });