[Bug-12960]Type Mismatch On Dataset Within Expressions Whether From Property Or Tag

#1

Trying to pull value from dataset. Dataset has data, but keep getting error saying “found QuailfiedValue”

try({this.custom.sessionDataset}[0,'stepNum'],-1)

0 Likes

[Bug-12960] Dataset access in perspective
#2

We’re looking into this to see if that’s how it would have worked in 7.9.X, but in the meantime you could bind against the this.custom.sessionData property, and apply a script transform of

if system.dataset.toPyDataSet(value)[0]["stepNum"]:
    return system.dataset.toPyDataSet(value)[0]["stepNum"]
return -1

to achieve the same result.

0 Likes

#3

We opened an internal ticket to fix the issue as both Perspective properties and even Tag values are failing to be properly recognized (Tag values fail because they’re recognized as objects instead of a dataset).

0 Likes

#4

Something we do in vision is add a dataset parameter to a screen then bind to the different columns in the dataset i.e. {Root Container.Table.data}[“ProductCode”]

In perspective does this work as well? {view.custom.FacilityTable}[“name”] isn’t working for me. The dataset does have a row in it.

image

Here is the entry in help “Expression Overview and Syntax”
“If you have an expression that returns a dataset, you can pull a value out of the datatset using the dataset access notation, which takes one of these forms:
{Root Container.Table.data}[“ProductCode”]”

Thanks!

0 Likes

#5

@jhottell I’ve moved your post here to keep everything together.

We’ve recently noticed that Datasets in Expressions are not working as expected. We’re looking into the issue, but I don’t have an ETA. Your attempt should work in the future, although you’ll need to try something like
try({view.custom.FacilityTable}[<row_index>, "<column_name>"], <desired_value>, <fallback_value>)

0 Likes

#6

BTW this was not my post!

0 Likes

#7

This issue was fixed in the build that was uploaded today (3/12).
Please let us know if you continue to see this behavior after upgrading.

0 Likes

#8

Took me a while to test but this works great now.

1 Like