Field Code Variables
Contents
Learn how you can use system variables, custom variables, and your own data in standard responses.
In the example given in Field Codes Overview, the Contact.FirstName retrieves a piece of data about the interaction. The ability to access interaction data is perhaps the most frequent use of field codes. Although field code formulas can be very complicated, many simply retrieve a single piece of data, such as a contact’s name.
You access Universal Contact Server data using predefined variables, called "system variables."
These variables access three predefined objects. Each object has a name and a set of properties. In the example, Contact is an object and FirstName is one of its properties. The system variable Contact. FirstName retrieves the value of the FirstName property of the Contact object.
In similar fashion, there is a system variable for each object+property pair. The objects and properties that you can use in field code formulas are described in the following sections.
Interaction
This object represents the particular interaction being worked on, such as an inbound e-mail. These are its properties:
- Id
- DateCreated
- Subject
- ToAddress
- FromAddress
- AttachedData
- TimeZone
Contact
This object represents the contact associated with the interaction being worked on. These are its properties:
- Id
- Title
- FirstName
- LastName
- FullName
- PrimaryPhoneNumber
- PrimaryEmailAddress
Agent
This object represents the agent working on the interaction. These are its properties:
- FirstName
- LastName
- FullName
- Signature
Custom Variables
In addition to the system variables, you can use eServices Manager to create custom variables. Custom variables have the following properties:
- Their values are assigned by strategy objects.
- Therefore, standard responses that use field codes containing custom variables must have the usage type Autoresponse or Acknowledgment.
For an example of the use of a custom variable in a standard response, see Using a Custom Variable.
Using Your Own Data in Standard Responses
It is possible to incorporate data that you keep external to Universal Contact Server into your standard responses (including automated responses). This data could include case numbers, account information, and so on. Remember that attached data always consists of key-value pairs. Incorporating external data into standard responses is a two-step process:
- Retrieve the external information and add it to the interaction as attached data. One place to do this is in a routing strategy.
- Now that you have attached the data to the interaction, you can use the AttachedData property of the Interaction object to access the data and incorporate it into your standard response. The AttachedData property requires one argument, which is the key name. The result of the following formula is the value associated with the OrderStatus attached-data key:
- <$Interaction.AttachedData("OrderStatus")$>