How bind to a client dataset tag

About a year ago, @alexlu said here that it should be possible to bind to a client dataset tag. It doesn’t seem to work with the suggested syntax. What should the magic syntax be?

Hi Bill,

I just confirmed that the client dataset tag expression binding I suggested still appears to be working. Can you clarify the issue that you're seeing?

It’s a Vision Client Tag that is generated from an SQL Query expression. It is a Dataset[10Rx2C] where col1 is of type Integer and col2 is of type Long.

If I try to bind the value property of a Numeric Label to any col,row using [client]ActiveTasks[col,row] and I get the following error:

The type of this tag (Dataset) is not assignment-compatible with the type of the property you are binding to (double).

In the end end, I want to bind to to a background color with a Number-to-Color Translation.

Tag export attached.
client-tags.xml (2.0 KB)

Can you post the expression you are using for the binding on the Numeric Label?

[client]ActiveTasks[0,1]

Try:

{[client]ActiveTasks}[0,1]

I also tend to like putting in the column name instead of the column index. This way if you accidentally add a column to the dataset it is pulling from, you are less likely to end up with a potentially nasty hidden bug that doesn’t throw an error:

{[client]ActiveTasks}[0,"TaskCount"]

Okay, that woks but it needs to be in an expression. Thanks!

Also, it seems that specifying the column with a name does not seem to work when the expression is nested in an if expression.

It works ok for me when I tried it in an if statement. I know sometimes I can get some weird type errors in various bindings but can usually fix it by wrapping it in a type casting function:

toDouble({[client]ActiveTasks}[0,"TaskCount"])

But this quick test works for me:

if(
     True,
     {[client]ActiveTasks}[0,"TaskCount"],
     -1
)

I was trying to do something like …

if(
     {[client]ActiveTasks}[0,"TaskCount"] > 0,
     color(1,1,1),
     color(100,100,100)
)

Anyway, I decided to use a lookup function inside and if functions.