How do I set filter in ui-table from a command

I am generating a table using mysql queries and ui-table in dashboard-2.

how can I set filter for a column be sending a msg.payload ? (from a dropdown for example)

could not find any example or a discussion in forum for this topic, some available for dashbaord-1

Not something we support out of the box currently

1 Like

Is it possible by using ui-template ? any hint or direction towards solution appreciated. :folded_hands:

You could filter the data in the sql query before sending it to the table.

Yes, that is my current setup. however, i am trying to reduce the time taken for creating a table for updating the downtime in each machine.
trying to explain.

  1. I have 20 machines connected to a PLC
  2. The data about production is updated every minute by the way of count of product in the last minute for each machine
  3. the main database is hence a table of count of product for each machine updated every clock minute with a timestamp
  4. now, at the end of a shift of 8 hours, i am asking the shift executive to update the downtime reasons.
  5. upon selecting a machine, the NR flow calculates the downtime (where count is zero) period by going through the database and creating another temporary table to effectively give the Machine/From Time / TO Time /Duration and a space holder for him to enter / select a downtime reason from a dropdown (which also comes from a database)
  6. this takes a while for each machine, and I want to automate this process of 'calculating' the downtime for ALL machines simultaneously without him need to select the machine each time he is done with one.
  7. I found that making a single table with all machines with downtime data is somehow faster and easier for the operator.
  8. but this is overwhelming for him to see all data at once on a screen, so i would like to filter the machines by clicking a button for each machine or by a dropdown, at this point all the calculations are already done, and i dont want to invoke a mysql query again to display the table, just want to show / hide relevant data.
  9. I am not sure i am making a valid point here, since
  10. if you cant explain something in simple sentences, then you must be doing it wrong

You can consider using @omrid01/node-red-dashboard-2-table-tabulator, which fully supports any type of filtering (e.g. configured, dynamic, conditional), including a persistence option.

2 Likes

I had given it a thought a few days back while following up a topic on forum, i will definitely look into this now.