# Ubidots Event

To trigger an UbiFunction via Ubidots' Events Engine, follow these steps:

### Create a new Event <a href="#id-1-create-a-new-event" id="id-1-create-a-new-event"></a>

To begin, create a new event from the "[Events](https://industrial.ubidots.com/app/events/)" section in the "Data" tab in your Ubidots Navbar.

<figure><img src="https://884329393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhzNRg0B4ECiNXc093G%2Fuploads%2FpZiOdijaQjQgTvoAfnTD%2Fimage.png?alt=media&#x26;token=106e91f2-013b-4183-9231-f723cd5271ee" alt="" width="252"><figcaption></figcaption></figure>

### Configure the Event Triggers <a href="#id-2-configure-the-event-if-trigger" id="id-2-configure-the-event-if-trigger"></a>

Next, configure the Event logic using Ubidots’ “ANDs” / “ORs” operators.&#x20;

For additional details on how to configure conditional and complex Event triggers, check out our [Creating Conditional Events and Alerts](https://help.ubidots.com/user-guides/events-creating-conditional-events-and-alerts) user guide.

<figure><img src="https://884329393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhzNRg0B4ECiNXc093G%2Fuploads%2FZzUVltlj6wFhvTLeojSS%2Fimage.png?alt=media&#x26;token=ad24bdad-259e-48e0-a27d-3823195fa4e0" alt=""><figcaption></figcaption></figure>

### Configure the UbiFunction Action <a href="#id-3-configure-the-ubifunction-then-action" id="id-3-configure-the-ubifunction-then-action"></a>

With the "Triggers" event logic configured, it is now time to create the action – in this case calling an UbiFunction:

**Step 1.** Select the "UbiFunction" action

<figure><img src="https://884329393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhzNRg0B4ECiNXc093G%2Fuploads%2Fps9DczfobDfMszqewgLo%2Fimage.png?alt=media&#x26;token=11554e07-7d02-45b6-b90d-08eecdfe9005" alt=""><figcaption></figcaption></figure>

**Step 2.** Select the method to trigger the UbiFunction: GET or POST. The UbiFunction must have the same method configuration. **NOTE:** when choosing GET, the default “Content-Type: application/json” will disappear.

**Step 3.** Search for and select the UbiFunction in the dropdown menu.

**Step 4.** Add the desired headers. POST requests will require the default “Content-Type: application/json” header.

<figure><img src="https://884329393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhzNRg0B4ECiNXc093G%2Fuploads%2FHiQakNMHxIoNatI8jq0A%2Fimage.png?alt=media&#x26;token=e0e55fda-1c70-4f3d-b9f8-32f40eeb3c8c" alt=""><figcaption></figcaption></figure>

**Step 5.** Customize the “Active trigger” and the “Back to normal” messages. **NOTE:** These fields always expect a JSON object. When the HTTP method is GET, the JSON is automatically converted to query parameters and appended to the UbiFunction URL.

<figure><img src="https://884329393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhzNRg0B4ECiNXc093G%2Fuploads%2FvwQym1RDYBnxx7y3nyvD%2Fimage.png?alt=media&#x26;token=f71ffa38-1d76-4138-85ab-2a9468ab9bac" alt=""><figcaption></figcaption></figure>

**Step 6.** Name the Event, set the active days and hours, and save.

<figure><img src="https://884329393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhzNRg0B4ECiNXc093G%2Fuploads%2FwDQpyo1XZU6zZGYlBVJb%2Fimage.png?alt=media&#x26;token=f6edd148-eec5-4c1d-b2f5-8257fd806680" alt=""><figcaption></figcaption></figure>

Your UbiFunction will now be triggered when your Event is triggered.
