Evaluate array in custom command

I have a custom service that calls a custom command. This command has multiple arguments that are used based on set_if. One of the arguments is optional but takes an array of values from service variable (e.g. vars.something = [ “something1”,“something2”].

In the command argument, how can I evaluate the contents of $something$ in set_if? I know I could create a new variable and set it to true/false and just evaluate it, but is using a function in set_if possible for this?

Thanks!

you can use icingadsl
https://icinga.com/docs/icinga-2/latest/doc/18-library-reference/#arraycontains
contains(value)

"-k" = {
            set_if = {{
                var myarray= macro("$something$"); return myarray.contains("something1");
            }}
}