angel.com
Home > Resource Center > Application Design > Variables

Application Design Application Design

Use Variables to Improve Your Application

In response to overwhelming demand, we have introduced the concept of variables in the Angel.com platform. You will see them pop up in Transaction Pages, Question Pages, Voicemail Pages and the brand-new Name & Address Capture Pages.

A variable is a piece of information that is either collected from a caller (such as a credit card number) or a piece of information returned by one of your scripts to the Angel system. As a call progresses, you will accumulate a number of variables, that you can use at any point within your application to route the caller in a specific direction.

Variables can be made available to scripts through Transaction Pages, while scripts can make variables available to other pages by returning AngelXML.

For example, if you use a Question Page with a Number as the response type to collect a zip code, you may name the variable something like "zip_code." You may later submit that number through a Transaction Page that checks the ZIP code and then uses other information to convert the zip to a zip+4. If you wanted to use the zip+4 number in the application, you could send it back to Angel in your AngelXML:

<VARIABLES>
<VAR name="zip_plus_four" value="20171-4051"/>
</VARIABLES>

Or, you could override the existing value:

<VARIABLES>
<VAR name="zip_code" value="20171-4051"/>
<VARIABLES/>

Variables can be nested easily, forming structures. It may make sense for you to group related info in a struct. For example, when providing a captured address the Angel system would use a struct like this:

<VARIABLES>
<VAR name="address" type="struct">
<VAR name="StreetNumber" value="1861"/>
<VAR name="StreetName" value="International Dr"/>
<VAR name="City" value="McLean"/>
<VAR name="State" value="VA"/>
<VAR name="ZIP" value="22102"/>
</VAR>
</VARIABLES>

Once your variables are in your script, they will be named easily, for example "address.StreetNumber", "address.StreetName", etc. With a naming scheme like this, some languages will even create object structures for you on your behalf. If not, you may still be able to create object structures yourself with a simple operation.

If you want to send all the variables in a struct, you can just name the struct in the Transaction Page and the system will take care of all the work.

We've also introduced a handy checkbox that sends all available variables in a Transaction Page. This is especially useful when you won't know in advance, at design time, what the variables will be called.

What do you think? We'd love to hear your feedback. Give us a call at 888-692-6435 and say "Developer Hotline".

Sam Aparicio

1,600+ Customers, 20+ Industries, 10,000+ Telephony Solutions