Triggers allow you to add logic to your app. You can use triggers to interact with devices, send alerts, communicate with backend systems, and more - all without writing a single line of code!

There are two types of triggers in a regular step: 

Button Triggers

Button triggers are activated when a button is pressed.  There can be multiple button triggers on a Step that are triggered when the respective button is pressed by an operator in the Tulip Player.

These can be accessed in the "Widget" menu in the Context Pane after selecting a button.

Step Triggers

Step triggers are activated with a step action such as: 

  • input from a device (“device”) 
  • at regular time intervals (“time fires”)
  • when the step is opened (“step open”) 
  • when the step is closed (“step close”) 
  • when there is an input from a machine (“machine”).

These can be accessed via the Step tab in the Context Pane.

Creating Triggers

Triggers work using a when, then logic structure: 

  • when "event registers in Tulip" 
  • then "take action". 

A slightly more complex version of this logic is triggers with condition:

  • when "event registers in Tulip" 
  • if "condition is met" 
  • then "take action"
  • else "take a different action" 

If you need to use "if/else" statements, check out this guide to triggers with conditions.

Events that drive actions can be simple things like a button press that causes the app to go to the next step. 

Or, they can be more complex actions like a barcode scan that queries a backend database to return order information as a variable. 

Here's more detail on the "Then" statement:

This Trigger uses a barcode scanner to: 

  • Retrieve Order Details from an external system, 
  • Save value as a variable
  • Auto-advance to the next step.

Use Cases for Triggers

Some examples of common actions you can take with triggers include:

Navigating within the App: Use triggers to go to the next or previous step. Or, navigate to a specific step such as a "Call for Help" step.

Complete the App: to log the data from a run of the app.

Calling a connector function to access a back end system: Connectors can be used to enable Tulip to talk with third party systems. These connectors can be called from within Triggers. This allows you to push or pull data from Tulip into a back end system using variables.

Sending Alerts: You can also use triggers to send emails or SMS alerts to a relevant administrator. These messages can include images, status information about the process, and other relevant information.

Storing Data: If you want to store data within Tulip, you can use:

  1. Variables: Data that is only relevant to one app
  2. Tables: Use a Table to store data that will be used across multiple apps

You will use the "Data Manipulation", "Store" command in a "Then" statement to accomplish this.

You can store any of the following data types:

  • Text
  • Number
  • Integer
  • Boolean
  • Time interval
  • Tulip User (either operator or administrator)
  • Image, either as a URL or manually uploaded image

For a list of all possible trigger actions, see this separate guide.

For a list of the top 10 most common triggers we see customers building with Tulip, check out this article, "What are the top 10 most common triggers in Tulip."

Did this answer your question?