Getting Custom Property as Array

Hi there,

I want to get a component custom property as an array.

As you know there is no array for datatype;
image

I can select string and i can use split for getting array. But it shouldnt be best way.

Is there any more usefull way?

*main purpose: to be able to process row numbers by selecting them separately

Thanks in advance.

Use a dataset type with a single column?

1 Like

I’ve done this in the past. IIRC dataset cells can contain objects, so you may be able to use a single cell for your array.

Be careful with this - while datasets support arbitrary data types, serialization does not, so you might think everything is working in the designer, then open the window in the client and have no data.

I would use a dataset in it’s “intended” form, as @lrose suggested.

2 Likes

I thought about using the dataset but for some reason I didn’t choose it. I changed what was causing this and used the dataset. seems to be working for now

Thanks for replies!

My question would be why arrays are not allowed?

This old topic is implicitly Vision. Until very recently, there simply wasn't a safe way to encode arrays and other complex types except for datasets. Ignition v8 added the Document datatype to tags and Perspective, but it wasn't backported to Vision until now (8.1.44). The document datatype can hold arrays and mappings, including nested arrays and mappings.

1 Like

Minor point of clarification: The document support that was added to Vision recently only supports top level objects. They can obviously contain any document element type inside, but at the top level must be objects. I explored supporting any element type briefly, but Vision's property and editing model really doesn't know how to handle something that can be either a 'primitive' like a string/number, or a complex object, or a complex array.

1 Like

Ah, hadn't tested yet, but not surprised.