Multiple Conditions for dmx-show attribute

Trying to add some multiple conditions to the dmx-show attribute. This is not multiple attributes, but multiple conditions for an attribute. For example, display an element if value A = x and value B = y and value C = Z. I can’t get it to work. This is what I have:

`dmx-show="WorkStarted == true && Workers = 0 && Status != "Workcomplete" "`

This does not seem to work. I’ve also used && instead of the escapement.

I have used this with multiple parameters many times, a simple one i did just yesterday was

dmx-show="pr_units == '1lB' || pr_units == '20lB' || pr_units == '50lD'"

dmx-show="serverconnect_role_checker.data.query_role[0].u_role == 'admin' || serverconnect_role_checker.data.query_role[0].u_role == 'groupadmin'"

So honestly I do not see anything incorrect with your physical code itself. Maybe try with each condition by themselves first and ensure each one does what you want, then add 2 together and see if that works before you add the != condition, also i think you could change the != to !Status == ‘Workcomplete’

I think you're missing an equal sign.

2 Likes

Good spotting @TomD, did not even see that, haha

Yes, good eye! That was is it! I was missing the equal sign. I spent hours on that! It's one of those things where you just know it's supposed to work, but there is something you are over-looking. Thanks @psweb and @TomD for your help.

I think the person who first decided that “=” should mean ‘assign’ and “==” should mean ‘equal to’ should have realised it would inevitably cause hundreds or thousands of extra hours debugging every year (IMO).

1 Like

Have to say I am really happy with the community and the support, I was straggling with the same issue, and as i was going to create a new ticket saw the suggestion on the left with this post!!!

Better then with VBScript where the equal sign is used for both.

myVar = "Hello"
If myVar = "Hello" Then
  For i = 1 to 1000
    Response.Write myVar
  Next
End If

Also having === for strict equal to.

My background is classic asp VBscript… So that was my excuse for missing it, lol.