The objective of this document is to give a high level overview of triggers and the Working with Triggers app that comes pre-installed on any new Tulip instance.
Triggers are the heart of the automation that makes Tulip apps powerful. Triggers can be accessed in a few places, buttons can have Triggers that execute actions, but so can different steps in your app, and machine or device output can also fire triggers. We will see a wide variety of trigger types throughout this document.
This isn't an exhaustive list of everything that can be done with triggers, for that check out this collection that documents almost everything that can be done with a trigger.
How the App Works
Adjusting the value of number variables is simple in Tulip, this step shows a few common ways you can adjust and interact with number variables in Tulip. Click onto any of the buttons to see their triggers.
Incrementing and decrementing values is simple in triggers. Select if you want to increment or decrement, select the variable you want to adjust, and select how much you want to adjust it.
Setting a value from input is a useful technique for overriding the value of a variable with another value. Select the input you want to write to the variable, then select the variable you want to adjust.
Multiplying a value by another requires an expression, but is incredibly simple. Division can be achieved the same way within an expression.
Resetting a value back to its default is a trigger action that is incredibly useful for resetting an app back to its original state. Maybe at the end of an audit you want to set all of the input fields back to blank, or after measuring one part you want to clear out the measured value back to zero in preparation for the next part.
Checking the value of a variable is a unique trigger on this step because it is using the "IF" condition of a trigger to check if matches in a condition. In this case we are checking to see if the current value is more than 10.
Working with Text
Working with text is a lot like working with numbers but you have some special functions available to further empower you as you build Tulip apps.
Adding to text or concatenating text is a technique often utilized when making unique identifiers for something. Maybe you want to combine the order number and the facility name together to act as the unique ID for your order tracking records.
Set text to a random value shows how to use the RANDOMSTRING() function, this function is super useful when working with tables. Table records need to have a unique ID field, and the 17 digit alphanumeric random string is a great starting point at generating unique IDs for each record.
Resetting text back to defaults works for text too!
Checking if a string contains another string is another incredibly powerful function. Check if a user has entered an input that matches your "Order: 12345" format with a contains "Order" conditional.
Step level triggers are a special type of trigger that enables a lot. Step triggers fire without a user needing to click a button, or interact with your app directly at all. There are 4 key types of step triggers: On Step Enter, Timer Triggers, Machine and Device Triggers, and On Step Exit.
To access step triggers, either deselect all widgets or select the STEP tab in the widget configuration slide out.
On step enter triggers will run when a user enters that specific step. These triggers are incredibly useful. You could create a new order record when the step is entered, turn on a pick to light configuration, and much much more.
Timer triggers run on a set interval. These triggers are useful for running periodic logging or conditional checking. maybe you want to periodically check if a shift change has happened, if it has you could logout the current user.
Machine and device triggers are how you will get data from machines connected to Tulip or the thousands of devices that can plug and with Tulip. When that device or machine outputs data, these triggers will fire and the data from that device can be accessed.
On step exit triggers act a lot like on step enter triggers, but they run when a user leaves a step. This can be useful for tracking the time a user has spent on a step in your process.
Changing between steps in a trigger is also a very useful technique. Tulip app steps can be run in order, but you can also dynamically change the order users interact with your app. Based on an order attribute you can change the process users follow.
Conditional logic allows your Tulip apps to be entirely dynamic based on user input, machine data, and more. Adjust the process users follow based on the assembly they select, determine if a user is eligible to see a page, only run logic if the number of later orders is more than 5, and much much more.
Tulip triggers run IF>THEN logic where a condition (the IF) is checked, and if it matches, the THEN logic will run. If that condition doesn't match, the trigger will check the next conditional (ELSE IF), if it matches it will run this logic. This process will continue until one of the if conditions has been met or no more if conditions exist.
In this case, we are checking the line variable. If the line variable is 1, we want to print the line selected and the text in the line 1 box. If line 2 is selected, we want to print the line, and the text in the line 2 field.
If the user doesn't select any option, the trigger will execute until an matching condition is found, in the case of this trigger there is a blank conditional and the end of the trigger. This code will always execute if the user enters something other than Line 1, Line 2 or Line 3.
Other Useful Triggers
There are tons of small useful trigger actions you can put to use in your apps
Open a website will open a webpage in your default browser. This is useful to open an internal intranet, send users to the supplier webpage to reorder, and more.
Open another Tulip app allows one trigger to open another app. Many customers use this to seamlessly move users from one process to another. Based on a barcode scan you could launch the correct assembly app for their SKU.
Logout the current user is a trigger action useful for times where you don't want users to have to logout of Tulip apps. Maybe at noon everyday shift change will happen so a timer trigger should automatically log everyone out.
Load an image is a dynamic way to change what content a user is seeing with a trigger. In this case, any image url can be added to the Link to open field and when the Load Photo button is clicked it will automatically be loaded. A light stack image on your app could dynamically change color based on the current throughput of the line
Send an email is a slick way to get information to decision makers. Send any Tulip user an email with customizable context to drive action where it is needed.
Print step triggers are useful so Tulip can incorporate with existing systems. This action will open the windows/mac print prompt where the user can select a printer and print their step. Generate 5S tags on the fly with this trigger action!
There are a handful of key tips around triggers not addressed earlier in this app, but important to understand when making more complicated trigger logic.
Multiple triggers can be added to a single widget. They will run in order from top to bottom. This can be useful when you want to copy triggers across steps, but you don't want to copy the entire. Each of these smaller triggers can be individually copied.
Triggers can be copied between buttons. Save yourself the legwork of recreating a long complicated trigger. Any trigger can be copied to other elements of the same type (a button trigger can only be copied to another button, for example).
Triggers can be toggled on and off. Simplify troubleshooting by limiting what logic is running or by toggling on additional troubleshooting triggers.
See all of your trigger types at a glance. With the tabs on the widget configuration side-out you can adjust step triggers, widget, or app triggers at any time.