> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kinetica.com/llms.txt
> Use this file to discover all available pages before exploring further.

# create_trigger_by_area

### create\_trigger\_by\_area

<ul>
  <li>
    create\_trigger\_by\_area(\
    &#x20;request\_id: string,\
    &#x20;table\_names: string\[],\
    &#x20;x\_column\_name: string,\
    &#x20;x\_vector: number\[],\
    &#x20;y\_column\_name: string,\
    &#x20;y\_vector: number\[],\
    &#x20;options?: Record\<string, string>,\
    &#x20;callback?: [GPUdbCallback](https://docs.kinetica.com/content/api/typescript/types/GPUdbCallback.md),\
    ): Promise\<[CreateTriggerByAreaResponse](https://docs.kinetica.com/content/api/typescript/interfaces/CreateTriggerByAreaResponse.md)>

    Sets up an area trigger mechanism for two column\_names for one or more tables. (This function is essentially the two-dimensional version of `create_trigger_by_range`.) Once the trigger has been activated, any record added to the listed tables(s) via `insert_records` with the chosen columns' values falling within the specified region will trip the trigger. All such records will be queued at the trigger port (by default '9001' but able to be retrieved via `show_system_status`) for any listening client to collect. Active triggers can be cancelled by using the `clear_trigger` endpoint or by clearing all relevant tables.The output returns the trigger handle as well as indicating success or failure of the trigger activation.

    #### Parameters

    <ul>
      <li>
        request\_id: string

        User-created ID for the trigger. The ID can be alphanumeric, contain symbols, and must contain at least one character.
      </li>

      <li>
        table\_names: string\[]

        Names of the tables on which the trigger will be activated and maintained, each in \[schema\_name.]table\_name format, using standard name resolution rules.
      </li>

      <li>
        x\_column\_name: string

        Name of a numeric column on which the trigger is activated. Usually 'x' for geospatial data points.
      </li>

      <li>
        x\_vector: number\[]

        The respective coordinate values for the region on which the trigger is activated. This usually translates to the x-coordinates of a geospatial region.
      </li>

      <li>
        y\_column\_name: string

        Name of a second numeric column on which the trigger is activated. Usually 'y' for geospatial data points.
      </li>

      <li>
        y\_vector: number\[]

        The respective coordinate values for the region on which the trigger is activated. This usually translates to the y-coordinates of a geospatial region. Must be the same length as xvals.
      </li>

      <li>
        `Optional`options: Record\<string, string>

        Optional parameters.
      </li>

      <li>
        `Optional`callback: [GPUdbCallback](https://docs.kinetica.com/content/api/typescript/types/GPUdbCallback.md)

        Optional callback function
      </li>
    </ul>

    #### Returns Promise\<[CreateTriggerByAreaResponse](https://docs.kinetica.com/content/api/typescript/interfaces/CreateTriggerByAreaResponse.md)>

    Promise\<Types.CreateTriggerByAreaResponse> - Promise resolving to the response

    <ul>
      <li>Defined in [src/GPUdb.ts:7180](https://github.com/kineticadb/kinetica-api-typescript/blob/master/src/GPUdb.ts#L7180)</li>
    </ul>
  </li>
</ul>

### create\_trigger\_by\_area\_request

<ul>
  <li>
    create\_trigger\_by\_area\_request(\
    &#x20;request: [CreateTriggerByAreaRequest](https://docs.kinetica.com/content/api/typescript/interfaces/CreateTriggerByAreaRequest.md),\
    &#x20;callback?: [GPUdbCallback](https://docs.kinetica.com/content/api/typescript/types/GPUdbCallback.md),\
    ): Promise\<[CreateTriggerByAreaResponse](https://docs.kinetica.com/content/api/typescript/interfaces/CreateTriggerByAreaResponse.md)>

    Sets up an area trigger mechanism for two column\_names for one or more tables. (This function is essentially the two-dimensional version of `create_trigger_by_range`.) Once the trigger has been activated, any record added to the listed tables(s) via `insert_records` with the chosen columns' values falling within the specified region will trip the trigger. All such records will be queued at the trigger port (by default '9001' but able to be retrieved via `show_system_status`) for any listening client to collect. Active triggers can be cancelled by using the `clear_trigger` endpoint or by clearing all relevant tables.The output returns the trigger handle as well as indicating success or failure of the trigger activation.

    #### Parameters

    <ul>
      <li>
        request: [CreateTriggerByAreaRequest](https://docs.kinetica.com/content/api/typescript/interfaces/CreateTriggerByAreaRequest.md)

        Request object containing the parameters for the operation
      </li>

      <li>
        `Optional`callback: [GPUdbCallback](https://docs.kinetica.com/content/api/typescript/types/GPUdbCallback.md)

        Optional callback function
      </li>
    </ul>

    #### Returns Promise\<[CreateTriggerByAreaResponse](https://docs.kinetica.com/content/api/typescript/interfaces/CreateTriggerByAreaResponse.md)>

    Promise\<Types.CreateTriggerByAreaResponse> - Promise resolving to the response

    <ul>
      <li>Defined in [src/GPUdb.ts:7136](https://github.com/kineticadb/kinetica-api-typescript/blob/master/src/GPUdb.ts#L7136)</li>
    </ul>
  </li>
</ul>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.