Unable to set a simple array condition using the interface

I wanted to set a Condition based upon the selection within a Drop-Down Menu. This is the Drop-Down Menu…

image

And here is the html as seen in DevTools…

image

If I enter things manually, like this, it works well…

dmx-bind:condition="[1,9].contains(select1.selectedValue.toNumber())"

But using the Bindings interface, things fail.

Here it is hand-coded in the Code view…

image

But this is how the same thing shows in Design view…

image

And this is what happens when you try to use the Data Formats panel, and the subsequent Error Notification…

image

I cannot set it in the Data Bindings panel. Is this an error or am I doing it wrong?

What is the condition you are trying to check?

If the value “1” or “9” are selected then show this code.

so why not simply…

dmx-bind:condition="select1.selectedValue == 1 || select1.selectedValue == 9"

Because the values will end up being dynamic and could contain, say, 20 different values.

You are saying that this part [1,9].contains is going to be dynamic, or?

Yes.
So it could be an array.
But it isn’t at the moment. As it stands now it could be up to say 6 values.

Tested locally with a dynamic array value and it works fine:

Probably there is an issue with entering [1,6] in the UI as it’s not really expected as a value there. Not sure if this can be improved @George

I appreciate your help as always.
So from what you say, I will be better off setting up an array manually.
Not sure how I should do that as this doesn’t work…

image

I think I have done it correctly now

So the array looks like this

<dmx-array id="arr1" dmx-bind:items="[1,9]"></dmx-array>

Hand-coded within the Code view…

image

And the Condition now looks like this…

dmx-bind:condition="arr1.items.contains(select1.selectedValue.toNumber())"

The only problem with this (not that it really is a problem!) is that I’ll need to set up lots of different array variables rather than hand-coding within the Condition code each time.