Class QBField<CustomGetSet>

Type Parameters

  • CustomGetSet extends Object = Record<any, any>

Hierarchy

  • QBField

Constructors

Properties

CLASS_NAME: "QBField" = 'QBField'
_data: Record<any, any> = {}
_fid: number = -1
_qb: QuickBase
_tableId: string = ''
_usage: {} = ...

Type declaration

    id: string

    An internal id (guid) used for tracking/managing object instances

    CLASS_NAME: "QBField" = 'QBField'
    VERSION: string = VERSION
    defaults: QBFieldOptions = ...

    The default settings of a QuickBase instance

    Methods

    • This method clears the QBField instance of any trace of the existing field, but preserves defined connection settings.

      Returns QBField<CustomGetSet>

    • This method deletes the field from QuickBase, then calls .clear().

      Parameters

      • __namedParameters: QuickBaseRequest = {}

      Returns Promise<QuickBaseResponseDeleteFields>

    • Get an attribute value

      Parameters

      • attribute: "tableId"

        Quick Base Field attribute name

      Returns string

    • Parameters

      • attribute: "fid"

      Returns number

    • Parameters

      • attribute: "id"

      Returns number

    • Parameters

      • attribute: "type"

      Returns string

    • Parameters

      • attribute: "addToForms"

      Returns boolean

    • Parameters

      • attribute: "usage"

      Returns {}

      • Type Parameters

        • P extends keyof QuickBaseResponseGetField

        Parameters

        • prop: P

        Returns QuickBaseResponseGetField[P]

      • Type Parameters

        • P extends string | number | symbol

        Parameters

        • prop: P

        Returns CustomGetSet[P]

      • Type Parameters

        • P extends string

        Parameters

        • prop: P

        Returns P extends keyof QuickBaseResponseGetField ? QuickBaseResponseGetField[P] : P extends keyof CustomGetSet ? CustomGetSet[P] : any

      • Get the set QBField Table ID

        Returns string

      • Parameters

        • __namedParameters: QuickBaseRequest = {}

        Returns Promise<void>

      • Get the Quick Base Field usage

        .loadUsage() must be called first

        Returns {}

        • Load the Quick Base Field attributes and permissions

          Parameters

          • __namedParameters: QuickBaseRequest = {}

          Returns Promise<QuickBaseResponseGetField>

        • Load the Quick Base Field usage

          Parameters

          • __namedParameters: QuickBaseRequest = {}

          Returns Promise<{}>

        • If a field id is not defined, this will execute the createField option. After a successful createField, or if a field id was previously defined, this will execute an updateField.

          If attributesToSave is defined, then only configured attributes in this array will be saved.

          If this executes a createField, the newly assigned Field ID is automatically stored internally.

          After a successful save, all new attributes are available for use.

          Parameters

          • attributesToSave: QuickBaseRequest & {
                attributesToSave?: QBFieldAttributeSavable[];
            } = {}

            Array of attributes to save

          Returns Promise<QuickBaseResponseGetField>

        • Sets the passed in value associated with the attribute argument.

          Parameters

          • attribute: "tableId"

            Quick Base Field attribute name

          • value: string

            Attribute value

          Returns QBField<CustomGetSet>

        • Parameters

          • attribute: "fid"
          • value: number

          Returns QBField<CustomGetSet>

        • Parameters

          • attribute: "id"
          • value: number

          Returns QBField<CustomGetSet>

        • Parameters

          • attribute: "type"
          • value: string

          Returns QBField<CustomGetSet>

        • Parameters

          • attribute: "addToForms"
          • value: boolean

          Returns QBField<CustomGetSet>

        • Parameters

          • attribute: "usage"
          • value: {}

            Returns QBField<CustomGetSet>

          • Type Parameters

            • P extends keyof QuickBaseResponseGetField

            Parameters

            • prop: P
            • value: QuickBaseResponseGetField[P]

            Returns void

          • Type Parameters

            • P extends string | number | symbol

            Parameters

            • prop: P
            • value: CustomGetSet[P]

            Returns void

          • Type Parameters

            • P extends string

            Parameters

            • prop: P
            • value: P extends keyof QuickBaseResponseGetField ? QuickBaseResponseGetField[P] : P extends keyof CustomGetSet ? CustomGetSet[P] : any

            Returns void

          • Sets the defined Field ID

            An alias for .set('id', 6) and .set('fid', 6).

            Parameters

            • fid: number

              Quick Base Field ID

            Returns QBField<CustomGetSet>

          • Sets the defined Table ID

            An alias for .set('tableId', 'xxxxxxxxx').

            Parameters

            • tableId: string

              Quick Base Field Table ID

            Returns QBField<CustomGetSet>

          • Test if a variable is a qb-field object

            Parameters

            • obj: any

              A variable you'd like to test

            Returns obj is QBField<Record<any, any>>

          • Returns a new QBField instance built off of options, that inherits configuration data from the passed in attributes argument.

            Parameters

            • options: Partial<QBFieldOptions>

              QBField instance options

            • Optional attributes: Partial<QuickBaseResponseGetField> & Record<any, any>

              Quick Base Field attribute data

            Returns QBField<Record<any, any>>

          Generated using TypeDoc