Page 1 of 1

Can a field have multiple prompts?

Posted: Mon Mar 26, 2018 11:12 am
by srmoser430
Hi Support Team,

Can a create a field that plays condition-specific prompts? For example:

<field name="fld_service" type="digits?maxlength=2">
<prompt cond="variable1 == TRUE'">
<audio expr="audio_file1">
<value expr="audio_tts_prompt_1"/>
</audio>
</prompt>
<prompt cond="'variable1 == FALSE'">
<audio expr="audio_file2">
<value expr="audio_tts_prompt_2"/>
</audio>
</prompt>

...


Thanks,
Scott

Re: Can a field have multiple prompts?

Posted: Mon Mar 26, 2018 12:31 pm
by support
Hi Scott,

You are correct in how you can control which prompt can be heard through the cond attribute of the prompt tag. There's a couple small edits that you would need to make to ensure it would work properly.

Code: Select all

<var name="variable1" expr="true"/>
<var name="variable2" expr="false"/>
<field name="fld_service" type="digits?maxlength=2">
  <prompt cond="variable1">
    This should be heard.
  </prompt>
  <prompt cond="variable2">
    This should not be heard.
  </prompt>
</field>
Note that the VXML boolean values are all lowercase. If you wanted to check against a specific value within them (ie. the string TRUE) then you would set the var and prompt to be:

Code: Select all

<var name="variable1" expr="'TRUE'"/>
<prompt cond="variable1 == 'TRUE'">
Regards,
Plum Support

Re: Can a field have multiple prompts?

Posted: Mon Mar 26, 2018 1:26 pm
by srmoser430
Thanks for your help!