Named query returning multiples columns with a label in Vision

Hello everyone!

Simple question here.

I have a label calling a named query, calling a store procedure. The storeproc return a single row with multiples columns.

Is there a way to show the data of a particular column in the label?


In Vision:
Not with a direct binding.

Consider adding a custom property of Dataset type, and then use the lookup() expression in an expression binding to pull the data from the column you want.

In perspective:
You can use a transform to pull the data as needed.

Set the return type of the named query binding to be “Json”. Then call the desired column like you would a dictionary object using a script transform


Wait nevermind. This is in vision. In that case you could just select the single column in the named query or SP and then create the named query as Scalar

No lookup required if only a single row. The expression would be:

try({}[0,'ColumnName'], 'someFallback value')

The try() covers the case of zero rows returned.


Problem solved! I really love Ignition :slight_smile: