Dynamically populating Single or Multiselect widgets
30 Sep 2022
2 Minutes to read
Contributors
Share this
Print
Share
Contents
Dynamically populating Single or Multiselect widgets
Updated on 30 Sep 2022
2 Minutes to read
Contributors
Print
Share
Article summary
Did you find this summary helpful?
Thank you for your feedback
Only display the currently applicable options in a dropdown Widget
In this article you will learn...
How to conditionally change the content of a dropdown widget
To best understand this article, make sure you have understood the basics of Single or Multiselect Widgets: Article
Using the dropdown widgets can be very powerful, especially when leveraging Arrays to populate them. But sometimes it is relevant to show different content to pick from, based on a condition. This can be achieved with a configuration table that contains the condition in the ID field as well as the different options comma-separated in the second field.
In a first selection widget, the downtime reason can be selected and with the click of a button, the respective dropdown options can be loaded from the Table. A trigger to do this would look like this:
The comma-separated text corresponding to the selected downtime reason is loaded into the Record Placeholder. The 'Split String'-function saves them to the array 'Dropdown options'. This Array is then populating the second single select widget.
When running the app, the second single select won't show any options as long as no downtime reason has been selected:
When a selection is picked in the first dropdown, and the Trigger on the button is applied, the second dropdown is populated accordingly:
Did you find what you were looking for?
You can also head to community.tulip.co to post your question or see if others have faced a similar question!
Widget
Widgets are the elements that make up a specific App Step. Widgets can display information to users, collect user input, or trigger app logic.
Common widgets include: Interactive Tables, Number inputs, Machine attribute widgets, and more.
Widgets
Widgets are the elements that make up a specific App Step. Widgets can display information to users, collect user input, or trigger app logic.
Common widgets include: Interactive Tables, Number inputs, Machine attribute widgets, and more.
Array
Arrays are a Tulip Datatype. Arrays are a list of other variables. Every element in an array must be the same type.
Arrays are very useful when managing multiple values that represent the same information.
ex. The measurements of 10 quality checks can be stored in an Array of Numbers, as opposed to 10 Number variables.
Tulip Tables
Tulip Tables are a global location to store your production data. Tables are made up of Records (rows). A single can be accessed from multiple apps or stations at the same time.
Table Record Placeholder
A Table Record Placeholder is a reference to a row in a Tulip Table. Table Records can be created either from the Table UI or from an App Trigger.
Array
Arrays are a Tulip Datatype. Arrays are a list of other variables. Every element in an array must be the same type.
Arrays are very useful when managing multiple values that represent the same information.
ex. The measurements of 10 quality checks can be stored in an Array of Numbers, as opposed to 10 Number variables.
Trigger
Triggers are the mechanism to do things in Tulip Apps. Store data, move users between Steps, Interface with hardware, Etc.
Triggers can be added to widgets, machines, devices, apps, and steps.
Was this article helpful?
Thank you for your feedback! Our team will get back to you