---
title: "Run a connector function in a trigger"
slug: "run-a-connector-function-in-a-trigger"
updated: 2023-05-03T15:36:36Z
published: 2023-05-03T15:36:36Z
canonical: "support.tulip.co/run-a-connector-function-in-a-trigger"
---

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

# Run a connector function in a trigger

## Overview

In order to access information from an MES or other external system, Tulip uses [Connectors](https://support.tulip.co/docs/what-are-connectors)

Once the [Connector Functions](/r230/docs/how-to-write-a-sql-connector-function) have been built, they can be initiated within an app via **Triggers**.

This means that when an operator presses a specific button within the Tulip Player, or uses a specific connected device like a barcode scanner, you can retrieve or store data in an external system.

Here's how the data will travel through Tulip to your system of choice:

1. Specify the Connector Function that should run within the Trigger
2. Specify the inputs for the connector function (if any are needed). These are usually [Variables from an app](https://support.tulip.co/docs/data-types-in-tulip)
3. If there are outputs from the connector function, specify which Variable should store theses values.

Here's a visual of the pathway:

Variable (or static value) in app --> Inputs to Connector Function --> Connector function runs --> Outputs --> Other Variable in app

This can be achieved by following the steps described below:

## Create The Trigger

1- Click on the "+" sign beside Triggers under the Step Tab of the Side Pane.

![](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/How%20to%20Call%20a%20Connector%20Function%20using%20Triggers_92226899.png)

2- Fill in a name for the new Trigger in the Trigger Editor.

3- Select **When** the trigger should run.

## Add the "Run Connector Function" Trigger Action

4- Select a Condition that will determine if the Trigger should run in the **If** section.

5- Add New Action by filling the section under “Then”:

- Select "Run Connector Function"
- Select the connector you wish to run
- Select the desired data input to the function (e.g a barcode scan, from a variable or even a static value)
- Select the Variable where you would like to store the outputs of the function (the variable will be an [array or object](https://support.tulip.co/docs/how-to-use-arrays-in-apps) depending on the connector function)

Here's an example:

![](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/How%20to%20Call%20a%20Connector%20Function%20using%20Triggers_92246558.png)

- "Run Connector Function" connector: "Server Assembly DB" "Get_Configuration"
- configuration: "Static Value" "text"
- and save result as: "Variable" "config_information"

          NOTE

          

In case the data received from the connector function contains several variables, Tulip will save each data input as a separate property within an object and you’ll be able to access each property separately.

## Further Reading

- [How To Use Arrays and Objects](https://support.tulip.co/docs/how-to-use-arrays-in-apps)
- [Examples of SQL Connector Functions](https://support.tulip.co/docs/common-sql-connector-functions)
- [Example of an HTTP Connector Function In An App](https://support.tulip.co/docs/http-connectors-by-example-part-1)

---

Did you find what you were looking for?

You can also head to [community.tulip.co](https://community.tulip.co/?utm_source=intercom&amp;utm_medium=article-link&amp;utm_campaign=all) to post your question or see if others have faced a similar question!

**Connectors**

**Connectors** enable real-time connectivity between your Tulip solution and a transactional system (e.g. an ERP). The output of a Connector Function can be used in Tulip Apps, Automations, and Functions.

- **HTTP Connectors** utilize HTTP API endpoints.
- **SQL Connectors** can enable connectivity with certain SQL databases.
- **MQTT Connectors** can connect to MQTT brokers for machine monitoring.

![](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/connector.gif)

**Connector Function**

**Connector Functions** are individual operations to interact with an HTTP or SQL Datasources. Connector Functions can have inputs and outputs, and can be called from: Triggers, Functions, Automations, and AI Agents.

Once pulled, data can be used throughout your applications.

**Trigger**

**Triggers** are groups of logic that are tied to an app event, such as step open, timer, widget interaction, etc. App builders can add triggers to **widgets**, **machines**, **devices**, **apps**, and **steps**.

**Triggers** can contain **actions**, **transitions**, and **conditions**.

**Tulip Player**

**Tulip Player** is the Windows/Mac executable program where users can run Tulip apps. Tulip player allows you to create a more seamless user experience by removing the need for a web browser and allows increased IT controls.

**Variables**

**Variables**are a location to store app information. Variables have a specific type that must match the contents they can store.

Variables are only accessible within a single application and are cleared when the app is restarted or completed.

**Variable**

**Variables**are a location to store app information. Variables have a specific type that must match the contents they can store.

Variables are only accessible within a single application and are cleared when the app is restarted or completed.

**Trigger**

**Triggers** are groups of logic that are tied to an app event, such as step open, timer, widget interaction, etc. App builders can add triggers to **widgets**, **machines**, **devices**, **apps**, and **steps**.

**Triggers** can contain **actions**, **transitions**, and **conditions**.

**Step Tab**

In the **Side Pane**, the**Step Tab**is where you can adjust all of the **Step-level**settings, including **Step Triggers,**Step background, Step resolution, and more.![](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Step%20Tab.png)

**Side Pane** **(Context Pane)**

The**Side Pane**is the configuration pane on the right side of the **App Editor**where steps, apps, and widgets can be configured. **Triggers**can be added to adjust widget behavior.![](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Context%20Pane.png)

**Action**

**Actions**are different operations that can be executed in **Triggers. Actions**cannot move users to other apps, or other**steps.**

Many **Actions**can be added to a single **Trigger.**

*ex. Store the value of variable x to table field y, Print app step, Adjust Edge device GPIO pin.*
