Skip to main content

listContains

A Workflow Engine function that returns true when the array field you query contains some of your specified values. Define values as an array, for example [ a ] or [ a, b, c ]. You must specify an array field, not a string.

This function is available for event, alert, and Situation workflows.

The workflow sweep up filter applies to this function.

Back to Workflow Engine Functions Reference.

Arguments

Workflow Engine function listContains takes the following arguments:

Name

Required

Type

Description

field

Yes

String

Name of the array field to check values in. You can specify custom info fields. The specified field must be an array of values not a string.

values

Yes

Object

List of values to check for, any intersection is valid. Define values as an array, for example [ a ] or [ a, b, c ].

Example

The following example demonstrates typical use of Workflow Engine function listContains. If you want to check for the existence of "Webserver" or "Webapp" elements in an array of services in custom_info, set the following:

  • field: custom_info.eventDetails.service_list

  • values: ["Webserver","Webapp"]

The UI translates your settings to the following JSON:

{"field":"custom_info.eventDetails.service_list","values":["Webserver","Webapp"]}

An object with the following custom_info value returns true:

"custom_info": {"eventDetails":
                    {"service_list": ["Webapp"] }
                }

An object with the following custom_info value returns false:

"custom_info": {"eventDetails":
                    {"service_list": ["Network"] }
                }