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 .
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 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
:-
Open the Rules Dashboard.
-
From the top navigation bar, if appropriate:
-
Select the Credential (Optional) dropdown, and choose a Credential.
-
Select the Priority dropdown, and increase or decrease the Priority.
-
See Rules Best Practices for more information on Priority.
-
-
-
In the IF section, select regexTest from the Type dropdown.
-
Select a parent field and a child field, if necessary, from the Field dropdowns.
-
Enter the values you're searching for in the Pattern field.
Separate the values you're searching for with vertical line operators (|).
-
Optionally, add a flag(s) to further refine your search.
Using an i flag makes flags article to learn more.
search for keywords without case sensitivity. Read this -
In the THEN section, select setTo from the Type dropdown.
-
Select a parent field and a child field, if necessary, from the Field dropdowns.
-
Enter the value you want the target from the If section to be set to in the Value field.
-
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 .
-
-
Click Create Rule.
-
In the Purpose section of the pop-up, enter text to describe the rule and click Add Purpose.