Dataset in Prespective

Hi,

i have a question, i need add dataset like properties in native object, but i have only 3 propose, 'object' - 'value' - 'array'.

With Vision Module its possible, ma with Prespective i dont know what to do...

Thanks so much in advance

Can you give more details? What native (built-in?) object? What is the source of this data? Is it from a binding?

I've removed the vision tag from your question title as the question is about Perspective (even though it mentions Vision).

Perspective does support datasets in object properties, but it doesn't provide a UI to create a property as a dataset. You can temporarily bind a runScript call to system.dataset.toDataSet() with constants to make one. Once there, you can manipulate it normally. Once you have one, you can copy its json form around.

I'm having the same issue and believe pturmel's post is the solution. Where in Perspective do I bind runScript to call system.system.toDataSet().

Thanks

Use an expression binding like so on the property you want to have a dataset:

runScript("system.dataset.toDataSet([], [])", 0)

That places an empty dataset on the property. Then delete the binding and you can use the dataset editor from there.

1 Like

Thanks. Next question is I have a query that returns a 1x2 dataset. I want value row 1, col 1 of that dataset for a label, and row 1, col 2 for say a max value on a dial. How do access these individually?

In an expression, use square braces.

In a script, use .getValueAt().

Thanks, that was it.