Share via


How to: Use Prompt Function Editor

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Use Prompt Function Editor to create and manage functions that dynamically generate one or more prompts based on the application's dialog flow.

Using Prompt Function Editor

Prompt Function Editor consists of three panes:

  • The top pane contains buttons for selecting, creating, deleting, and renaming prompt functions.
  • The middle pane is the Parameter window, where you enter names, validation values, and run-time values of prompt function parameters.
  • The bottom pane is the Script Editor window, where you define custom behavior for the prompt function by entering script code.

To open Prompt Function Editor

  1. In Solution Explorer, select the Web-based voice response application.

  2. On the File menu, click NewFile. The New File dialog box appears.

  3. In the Categories pane click the Speech node, and then in the Templates pane double-click Prompt Function file.

To select a prompt function

  • In the Prompt function list, select a prompt function.

To add a new prompt function

  1. In Prompt Function Editor, click New.

  2. In the New Function dialog box, enter the function name, and then click OK.

  3. In the Parameter window, select a row.

  4. In the Parameter Name column in the selected row, enter the name of the parameter.

  5. In the Validation Value column in the selected row, click the cell to open the Validation Values dialog box.

  6. In the Validation Values dialog box, enter values for the parameter.

    Entering parameter values is optional. The Web-based voice response application does not use parameter values at run time. Instead, the Prompt Validation tool uses parameter values to help verify that the prompt database has the expected coverage. Enter one value, or a range of values, for each line:

    • Indicate ranges by entering low and high values separated by a dash (for example, 1-7).
    • Enter string values enclosed in quotation marks (for example, "Seattle").
  7. In the Runtime Value column in the selected row, enter the property or variable in the application that provides the parameter's input value.

    To create a prompt that contains text from the results of a recognition, use the client-side SemanticItem object's value property. Create a parameter that uses SemanticItem.value as its run-time value, where SemanticItem is the unique ID entered in the New Semantic Item dialog box.

  8. In the Script Editor window, add additional lines of script as needed.

To delete a prompt function

  1. In Prompt Function Editor, select a function name in the Prompt function list.

  2. Click Delete Function, and then click Yes.

To rename a prompt function

  1. In Prompt Function Editor, select a function name in the Prompt function list.

  2. Click Rename Function.

  3. In the New Function Name dialog box, enter the new function name, and then click OK.

Search and Replace in Prompt Functions

Search and replace functionality is not supported by Prompt Function Editor. To search or replace code within the function, it is necessary to use a different editor.

To search in a prompt function

  1. In Solution Explorer, right-click the prompt function file (.pf), and then click Open With.

  2. Choose Yes.

  3. In the list of editors, select HTML/XML Editor, and then click Open.

  4. If the file was being edited in Prompt Function Editor, choose Yes to close the .pf file when prompted.

  5. In making the necessary changes to the file, ignore the warning not to hand-edit the file as long as there are edits only to the script in the body of prompt functions, and you:

    • Modify only the function bodies contained in the commented-out block of XML markup at the top of the file. Do not edit any of the XML markup.
    • Do not change the function prototype of any prompt functions.
  6. Save and close the file.

  7. In Solution Explorer, double-click the .pf file to reopen the file in Prompt Function Editor, and then save the .pf file.

    This step ensures that the actual script and the XML are synchronized.

Referencing Library Functions During Validation

A Web-based voice response application can reference script files that contain library functions. References for use by the Web-based voice response application at run time reside in script on the .aspx page. However, during prompt coverage validation, references on the .aspx page are unavailable. Enter references for validating prompt coverage in the Includes for Validation box.

To create a script reference for use during validation

  • In Prompt Function Editor, enter the script file names in the Includes for Validation box.

    Use semicolons as separators when adding more than one file name (for example, MyFunctions.js;MyOtherFunctions.js).

See Also

Other Resources

Prompt Functions in Web-based Voice Response Applications
Develop Prompts with Speech Prompt Tools