Skip to main content
Skip table of contents

User Functions Tab


User functions are there to help compute the message of a prompt or an announcement. You can use javascript, write your own code, apply your business logic and at the end, literally return a string. This string will be used in an announcement or in a prompt.

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. Click the +Add User Function button

  2. Enter the User Function Name

  3. Enter the Javascript to configure the User Function

  4. Click the Save Changes button to save changes

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

User Function application example

Based on the telephone number the caller is calling (params.Dnis), the miniApp can find out which branch the caller called. The miniApp announces the brunch city name through a welcome prompt as configured through a User Function Javascript.

User Function Javascript

if (params.Dnis.startsWith('505')) {
   'New Mexico'
} else if (params.Dnis.startsWith('272')) {

You can use the following values in your javascript code:

  • params.Ani

  • params.Dnis

  • params.extValue1

  • …​

  • params.extValue10

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

To get the string returned by your function, use {{MyFunctionName}} in the corresponding prompt.

For more information on how to complete JavaScript in User Functions please read JavaScript Functions in miniApps.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.