Force a SQL Query for a Tag

Is it possible to force a SQL query to update a tag value that has a SQL Query expression binding?

Back story…

I have several Client tags that are bound to SQL Query expressions. I have the Polling Mode set to “Off” because these tag values could go for weeks or months and never need updating because the values in the database typically won’t change. They are values that are customizable by the user that represent colors to be used for various device states.

However, I have a window that allows a system admin to change these values using and Editable Table component. I want to have a button that the admin can press when he is done with the changes to immediately force the SQL Query for those Client tags so that the UI is properly updated to display the new colors.

Can forcing the query be done? Or do I need to set the query to some polling rate even though there may never be updates?

Thanks -

1 Like

You cannot programmatically refresh the query on a client tag. However, you can create a tag (in the global folder) called MakeQueryUpdate that is a boolean. You can use that tag in your query like this:SELECT Col FROM Table WHERE {[~]MakeQueryUpdate} IN (0,1)So if you write to the tag it will make the query refresh since it is dependent on it. That will happen on every client since the tag is in the global folder. If you want it per client create the MakeQueryUpdate tag in the client scope.

1 Like