User functions are there to help do computations before you announce. You can use javascript, write your own code, apply your business logic and at the end, literally return a string. This string will be announced if used in an announcement.

User Functions are available for the following miniApps' Types:

  • Intent

  • Announcement

  • CorpusCollection

  • Text

  • Alphanumeric

  • Alpha

  • Numeric

  • Date

  • YesNo

  • Entity

  • Intelli

  • WebService

Add a User Function

In the User Function tab:

  1. Enter the User Function Name

  2. Enter the Javascript to configure the User Function

  3. Click the Save Changes button to save changes

  4. Click the +Add User Function button to add another User Function and follow steps 1-3.

User Function application example

The miniApp requests the callers' city zip code. The city name is configured through a User Function Javascript.

miniApp request

"Please give me your {{speakCity}} zipcode"

User Function Javascript

if (response.city == 'NY') {
   'New York'

You can use the following values in your javascript code:

  • Ani

  • Dnis

  • extValue1

  • …​

  • extValue10

Your javascript function must always return a string in the end.