# Dynamic Menu

![](/files/-M5NbiXxDsDOytHYtCRX)

{% hint style="danger" %}
**This is an advanced module**
{% endhint %}

## **Function**

This module provides end users with the same options as the [Menu](/fuse/input/menu.md) (<img src="/files/-M4u9_0zJArHYgTyjt_5" alt="" data-size="line">) module, that is, a way to branch on, and collect complex input.

Dynamic menus enable users to create multiple choice questions where each choice is associated with a value, where the choices can come from a dynamic source (like a web service) and not configured explicitly in the Fuse platform like the Menu module expects.

The maximum number of options available in the module is 10.

Enabling speech recognition generates an additional column in the module called ‘*Utterance*.’\
Each speech enabled option expects a DTMF input, a speech utterance, and a corresponding value. Please see the [Enable Speech Input Setting](/fuse/input/dynamic-menu.md#enable-speech-input-dynamic-menu) for more information.

{% hint style="info" %}
It is recommended to only enable speech recognition when absolutely necessary. Introducing speech recognition increases the chance of errors occurring and can detract from the end-user experience.
{% endhint %}

## **Variable Data Structure**

For the Dynamic Menu module to function properly, a data structure needs to be provided as the *Menu Variable* to tell the module which options will be available to the caller.

The data can come from a webservice JSON response using the [REST](/fuse/data/rest.md) (<img src="/files/-M4u9_1ajC7GIKRSWvr_" alt="" data-size="line">) module. Alternately, it can be built upon with Javascript using the [Evaluate JS](/fuse/data/evaluate-js.md) (<img src="/files/-M4u9_0dW34reXbZ8q03" alt="" data-size="line">) module.

The menu data needs to in the following data structure:<br>

| Code Example                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | Fields                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><code>\[</code></p><p> <code>{</code> </p><p>   <code>"dtmf": 1,</code> </p><p>   <code>"value": "chocolate",</code> </p><p>   <code>"prompt": { "en-US": "For Chocolate, press 1" }</code>  </p><p> <code>}, {</code> </p><p>    <code>"dtmf": 2,</code></p><p>    <code>"value": "strawberry",</code></p><p>    <code>"prompt": { "en-US": "For Strawberry, press 2" }</code></p><p> <code>}, {</code></p><p>    <code>"dtmf": 3,</code></p><p>    <code>"value": "vanilla",</code></p><p>    <code>"prompt": { "en-US": "For Vanilla, press 3" }</code></p><p> <code>}</code></p><p><code>];</code></p> | <p><em><strong>dtmf</strong></em>: The touch tone value of the entry<br><em><strong>value</strong></em>: Result value of the menu selection<br><em><strong>prompt</strong></em>: The text-to-speech prompt presented to the caller. This is a name-value pair where the language is the key.<br><br>For speech enabled menus, <em><strong>utterance</strong></em> is used to specify the word that is expected to be spoken by the Caller. See the <a href="/pages/-M5NxnfHTv8ki1R8Hk_K#enable-speech-input-dynamic-menu">Enable Speech Menu</a> setting for more information</p> |

![](/files/-M5NbiXyStdCK12KHP5E)

The variable `icecream` will contain the caller's selection based on the *value* field in the data structure.\
For example, if the caller presses 1 in the menu, the result will be “*chocolate*”, therefore, at the end the caller will hear:&#x20;

> *You have selected chocolate*

## **Module Settings**

![](/files/-M5NbiZ0aEtMSJZZOaWD)

### [Barge In](/fuse/module-settings.md#barge-in)

|                                                                     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <img src="/files/-M5NbiYYxRnf29GOm3YO" alt="" data-size="original"> | <p>This setting allows callers to interrupt a prompt before it finishes playing.<br>When enabled, DTMF input interrupts the prompt and progresses the call forward in the call-flow. If speech recognition is enabled on the ensuing module in the call-flow, then end-users can also interrupt the prompt with a spoken utterance, too. Disabling barge-in forces callers to listen to the entire prompt.<br><br>A barge-in enabled module will have a dashed line on top of the text box. See example <a href="/pages/-M4zJLOnor8aJqMZ7an7#visual-indicators">here</a>.</p> |

### [**Enable Speech Input (Dynamic Menu)**](/fuse/module-settings.md#enable-speech-input-dynamic-menu)

|                                                                     | <p><br></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <img src="/files/-M5NbiYdHGfefmrEZUR_" alt="" data-size="original"> | <p>This setting enables Automatic Speech Recognition (ASR) for the menu module.<br>A green microphone (<img src="/files/-M4u9_1letfsNlNQcxxt" alt="" data-size="line">) icon appears in the module when this is enabled.<br><br>This setting allows expects additional “<em>utterance</em>” field much like the setting in a normal <a href="/pages/-M5Nxnn-wSo5gBhz0ImX">Menu</a> (<img src="/files/-M4u9_0zJArHYgTyjt_5" alt="" data-size="line">) module.<br><br>The following code shows the expected data structure for using utterance:</p><p><code>\[{</code><br>  <code>"dtmf": 1, "value": "red",</code><br>  <code>"prompt": { "en-US": "For red, press 1 or say red", "es-US": "Para rojo, oprima 1 o diga rojo" }</code><br>  <code>"utterance": { "en-US":"red","es-US": "rojo" }</code> <br><code>}, {</code> <br>  <code>"dtmf": 2,</code><br>  <code>"value": "green",</code><br>  <code>"prompt": { "en-US": "For green, press 1 or say green", "es-US": "Para verde, oprima 2 o diga verde" }</code><br>  <code>"utterance": { "en-US":"green","es-US": "verde" }</code> <br><code>}, {</code><br>  <code>"dtmf": 3,</code><br>  <code>"value": "blue",</code><br>  <code>"prompt": { "en-US": "For blue, press 1 or say blue", "es-US": "Para azul, oprima 3 o diga azul" }</code><br>  <code>"utterance": { "en-US":"blue","es-US": "azul" }</code><br><code>}];</code></p> |

### [**Interdigit Timeout**](/fuse/module-settings.md#interdigit-timeout)

| ![](/files/9T5R1DvdfB539xCHA3qb) | <p>This allows users to set the maximum time, in seconds, that elapse between inputting digits before returning a timeout error. This applies to all input modules that accept multiple digits, like Date/Time, Number, and Digits.</p><p></p><p>The default value is 1 second. Acceptable number values range from 1 to 60.</p> |
| -------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

### [Private](/fuse/module-settings.md#private)

|                                                                     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| <img src="/files/-M5NbiYoLH9-yNY0kT9f" alt="" data-size="original"> | <p>This setting controls the logging function of a module.<br>Enabling the 'Private' setting instructs the module to not record, report, or retain the information input to that module for reporting or any other purposes. When enabled any information entered into a module during a call will be lost immediately when the call terminates.<br>The 'Private' setting is critical for businesses that need to maintain PCI-DSS or HIPAA compliance.<br><br>The module icon, in the upper left-hand corner, becomes grayed-out when this setting is enabled. See more details <a href="/pages/-M4zJLOnor8aJqMZ7an7#visual-indicators">here</a>.</p> |

### [**Show Custom Errors**](/fuse/module-settings.md#show-custom-errors)

|                                                                     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <img src="/files/-M5NbiYpIlBkq4cl4qvN" alt="" data-size="original"> | <p>Enabling this setting overrides the default, global error options set in the <em>Application Settings</em> > <a href="/pages/-M4z6BCTQuqNA3eCMpwL"><em>User Input Settings</em></a>.<br>This allows users to establish custom error handling in order to act on errors in a specific way in that module.<br>Instead of progressing to the next module in the call-flow, custom error handling allows users to re-prompt the same module, to provide a custom error message, to re-direct the call based on the error, or any other desired behavior.<br><br><img src="/files/-M5NbiYbI6eYm52-OxpX" alt="" data-size="original"><br><br>Adding multiple errors (<img src="/files/-M4u9_-hAMbYcqwmycsz" alt="" data-size="line">) to a module functions behave the same way as a counter.<br>The first error follows the path for the first error listed, if a second error occurs in the same module it follows the second listed error, and so on until all errors are exhausted or an error directs the end-user away from that module.<br><br><img src="/files/-M5NbiY_foh37_Qrs6hH" alt="" data-size="original"> No Input occurs when the caller does not provide an input based on the timeout settings.<br>This is based on the “<em>Initial input timeout</em>” in <a href="/pages/-M4z6BCTQuqNA3eCMpwL">User Input Settings</a><br><br><img src="/files/-M5NbiYaOoi9NNH22Sav" alt="" data-size="original"> No Match occurs when the caller input does not match the module's criteria for the input module.</p> |

### [Timeout Length](/fuse/module-settings.md#timeout-length)

|                                                                     |                                                                                                                                                                                                                                                                                                                     |
| ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <img src="/files/-M5NbiYv3-c_ACDrj4Um" alt="" data-size="original"> | <p>This allows users to set the maximum time, in seconds, that elapse before returning a timeout error. This applies modules that fetch outside scripts, like the SOAP, REST, or subdialog modules.<br><br>The default value for Timeout Length is 30 seconds.<br>Acceptable number values range from 1 to 120.</p> |

### **Advanced Settings**

Advanced Fuse users may want to use shadow variables that are available with input modules. For more information on this functionality, please visit the [Shadow Variables](/fuse/variables/shadow-variables.md) page.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.plumvoice.com/fuse/input/dynamic-menu.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
