Procedure: Using a Custom Variable
Purpose: This is a simple example of the use of a custom variable in a standard response.
This example assumes a category tree that includes categories called Cookbooks, Mysteries, and Reference.
- In Knowledge Manager:
- Create a custom variable called QueryTopic (see See Creating field codes).
- Create a field code called Query_Topic that consists of the variable QueryTopic.
- Create a standard response of type Autoresponse called AUTO that includes the sentence Thank you for your inquiry about <$ Query_Topic $>.
- Create the following screening rules:
Cookbook: RegExFind("cook") || RegExFind("recipe") || RegExFind("food") || RegExFind("cuisine")
Mystery: RegExFind("murder") || RegExFind("crime") || RegExFind("case of the") || RegExFind("detective")
Reference: RegExFind("dictionar") || RegExFind("encyclopedia") || RegExFind("almanac")
- In Interaction Routing Designer, create a strategy that applies these screening rules one after the other, assigning a different value to the custom variable for each screening rule:
- Create a variable called var_screen.
Create a strategy. Start the strategy with a Screen object. On the General
tab of the Screen object, select the Cookbook rule.
On the Result tab, click Assign values of the key-value pairs.
Then under Output values select var_screen for Variable and enter ScreenRuleMatch for Key from output.
Connect the Screen object to a Generic Segmentation object. Create two segments: var_screen = true and var_screen = false.
Connect an Autoresponse object to the top green port (the one corresponding to true) of the Segmentation object. In the Autoresponse, select the Select standard response radio button and select AUTO in the associated drop-down list.
Still in this Autoresponse, go to the General tab and in the Field Codes area (bottom of the tab) click the New icon, enter QueryTopic under Key, and enter cookbooks under Value.
This will generate an e-mail that includes the sentence Thank you for your inquiry about cookbooks.
Return to the Generic Segmentation and connect a new Screen object to its second green port (the one corresponding to false).
On the General tab of the new Screen object, select the Mystery rule. On the Result
tab, click Assign values of the key-value pairs. Then under Output values select var_screen for Variable and enter ScreenRuleMatch for Key from output
Proceed as in Steps d–f: Connect this Screen object to a new Generic Segmentation, again with segments for var_screen = true and var_screen = false.
As in Step e, connect a new Autoresponse object to the green port for true,
select the AUTO standard response, and enter QueryTopic under Key. This time enter mysteries under Value.
Return to the second Generic Segmentation’s green port for false and repeat Steps g–j, creating a third Screen object and Generic Segmentation. In the Screen object, select the Reference rule; in the Segmentation object, set the custom variable to reference
The figure "Strategy Using Custom Variable" shows the strategy as described. The single standard response AUTO generates three e-mails, each with a different word filling the blank in Thank you for your inquiry about ___.