Contains Function

The Contains function is used in the Logic Editor and Visibility Expression Editor to determine if a value contains a specific sequence of characters. It returns True on a match, or False when there is none.

Example

In this example, we will check to see if an SNMP Object is reporting a specific string value.

In the below example, we already have the Start block configured to fire when the SNMP Object's status value changes.

To check if the SNMP Object's status string contains a specific value:

  1. Drag and drop a Logic block into the work area, and connect it to the Start block.
  2. Double click the Logic block to open the Logic Editor.
  3. Click the Contains function button.
  4. In the Expression pane, click Input to enter the SNMP Object status value.
    1. Click the Advanced button.
    2. Navigate to the SNMP Object asset whose status tag is being checked.
    3. In the Properties pane, double-click Current Status Value then click OK.
    4. Click OK again.
  5. In the Expression pane, click Characters to enter the character sequence we are looking for.
    Note: If searching within a Date/Time input, make sure you are aware of the formatting for the Date/Time used on your system, and adjust your Characters string accordingly.
    1. Enter the string to be checked for in the Input value.
    2. Click OK.
  6. In the Expression pane, click Case Sensitive.
    1. Select True if you want the Characters search to be case-sensitive, otherwise select False.
    2. Click OK.
  7. Click OK.

From here, we can configure the rest of the Workflow to complete actions based on whether or not a match was found.