Regex Test Set To

This article outlines how to use regexTest to create a rule that looks for a list of keywords and, if found, sets a new value in VMS Sync.

Use Cases

The primary use for regular expressions is to include multiple keywords in an If statement. RegexTest searches for records that contain any keyword from a list of keywords you specify. You can then tell VMS Sync to take a particular action if any of those keywords are found.

For example, you may want to notify users of region-specific requsition activity. You can use regexTest to search for records in the VMS that contain any of a list of keywords in the reqDetails.city field. You can then add email address values (single or multiple separated by commas) to the additionalDetails.additionalNotificationEmail field, and VMS Sync will notify them any time a requsition with any of the If keywords is processed.

Steps

Do the following to create a rule that looks for a list of keywords and, if found, sets a new value in VMS Sync:

  1. Open the Rules Dashboard.

  2. Click Create +.

  3. From the top navigation bar, if appropriate:

    1. Select the Credential (Optional) dropdown, and choose a Credential.

    2. Select the Priority dropdown, and increase or decrease the Priority.

  4. In the IF section, select regexTest from the Type dropdown.

  5. Select a parent field and a child field, if necessary, from the Field dropdowns.

  6. Enter the values you're searching for in the Pattern field.

    Separate the values you're searching for with vertical line operators (|).

  7. Optionally, add a flag(s) to further refine your search.

    Using an i flag makes VMS Sync search for keywords without case sensitivity. Read this flags article to learn more.

  8. In the THEN section, select setTo from the Type dropdown.

  9. Select a parent field and a child field, if necessary, from the Field dropdowns.

  10. Enter the value you want the target from the If section to be set to in the Value field.

  11. Click Test Rule.

    • The preview will show the recent positions the rule was applied to.

    • Click a result to view the JSON with highlighted values (IF = Blue, THEN = yellow).

    • You can use the Specific Position field to test a specific req ID.

      The rule would look like this if you want to search for records with a list of city keywords and set their additionalNotificationEmail field to "example@email.com" in VMS Sync.

  12. Click Create Rule.

  13. In the Purpose section of the pop-up, enter text to describe the rule and click Add Purpose.

    • Example: Priority = High