Dynamically update table based on selection from drop-down in perspective

Hi everyone.

I am new to ignition and am facing a problem. So i have 10 tag folders of 10 machines containing 10+ tags each which are live and have their history stored. Now, i want to populate my table(which will contain other tags…let’s say some temperature values, etc) based on selection of machine in the drop down. I also want to add a date time selection component wherein I want to want my table to populate the machine from the drop down and also in the datetime range that i select in the datetime selection component.

Help will be much appreciated.

  1. Create a named query to get the basic information you require for one machine. Test it to check it works.
  2. Add parameters to the query so that you can have the query modified based on input parameters. (Read the documentation warnings about using QueryStrings.) Value parameters are safe and can be added to the WHERE clause using the :paramname syntax. Test this to check that it works.
  3. Create your dropdowns with the parameters for the query.
  4. Create a binding on the table data. Select Query and your named query. For each of the fx values bind them to the relevant dropdown’s props.value.

Have fun.

1 Like

Hi there…
I am not storing the values back in a SQL database. I am storing it in PostGres. And i exactly don’t know where the tags are historically stored. Till now i fetch the tags history by using scripting, tag history calculations method. Can you suggest some other way. Also, i think my question was not that clear. I’ll rephrase it.

So i have 10 machines, with let’s say 5 tags each, all of them have history enabled. These 5tags are stored under each different machine name tag folder. Now…what I want is that…

I want to populate my table component in perspective which will contain those 5 tag values as 5 columns. And now i have my drop down which contains 10 machines. I basically want to populate these 5 columns in my table component according to the selection of machines that i make in in the drop down. And if possible if i can incorporate a date time component like the drop-down so that my table shows values of certain selected machines for a certain time period…

I hope i am clear…can you now suggest?

This is SQL. In fact, its proper name is PostgreSQL. “SQL Server” is commonly understood to mean “Microsoft SQL Server”, but “SQL” is a brand-independent term.

:slightly_frowning_face:

/pedantry

2 Likes

You need to build a [where] string by dropdownsd dymanically and pass your where to sql query as parameter

Something like… (Un Tested and this is MYSQL, sounds like it will differ for Postgre)

  • FromDate and ToDate should be Value type.
  • Data Type should be Date.
  • In the query they should be written as :FromDate and :ToDate.
1 Like