How to change the dataset of a dropdown box

Hi all!

Could you give me an idea how to get the dataset of a dropdown to be changed when a specific value from another dropdown is being selected? Thanks!

If the second drop down is based off of a query, which is associated with the first drop down it should refresh itself as different values are selected in the first.

Thanks for the reply Jim!

Both of the Dropdown boxes have predefined datasets (I have entered them manually). In the first one there is a list of different types of machines. Where in the second should be filtered depending on what kind of machine is selected in the fist dropdown. It can be seen in the second snapshot that BMM machines are labelled as 1 and in the first one the type is 1 and finishers are labelled as 2.

Can you put them into a database, that makes it so easy down the road to add stuff.

If you can’t put it into a database, or the response time is an issue, the view() expression function in the Simulation Aids module can do this for you:view('Select StationID, StationDesc Where Type==args[0]', {Root Container.AllStations}, {Root Container.FirstDropDown.selectedValue})Move the second dropdown’s dataset to a custom property of the root container as shown (or elsewhere). This will be blistering fast as it will not call out to the database. If possible, the list of all stations should still come from the database, but can be a non-polling query that only runs once when the client loads.

Another option could be to create dataset memory tags to hold your data, then create the data sets in the drop downs through scripting. Kind of a hybrid system. Then it will still be faster because you aren’t accessing the database, but you can change your data easily without having to modify the project and publish.

Here is a screen you can import into a test environment to look at, it also has the sql code in some text fields to make the sql tables.

(This is out of 7.7.4 Ignition)

Thanks for the replies, gents!
I have been off work in the last few days and will take a look now!