Forum Discussion

SeanC's avatar
5 years ago

Allow for custom properties that are an array, not a string

Please let us create properties that are arrays so that we can use the contains() method.

  • Anonymous's avatar
    Anonymous

    What's your goal? Can you give an example? Several of the inbuilt properties are technically arrays, but you can use strings that are separated by commas or other separator to approximate an array. Most people misunderstand how contains() works, let's make sure we're solving the problem instead of mapping a rabbit hole.

  • Yeah, presumably this is Groovy, so match code (without ambiguity as I have seen in some modules) would tend to look like property.split(',').contains(value).

    That said, please please please fix property management in the UI so long strings are manageable.  I have many other property-related wishes :).

  • Anonymous's avatar
    Anonymous

    That's right @mnagel. If groovy, .contains() is a different thing.

    However, if the question is about the contains function in AppliesTo (which is invented by LM), then it's a little different. Source info here.  Know that .contains() works on a property that is an array, but only certain system properties are arrays. In most cases however, .contains() isn't used internally. Instead. a .join() is used to join the array and return a string against which RegEx can be used to match. 

    More info needed from the OP.