We've Moved! Please visit our new and improved forum over at our new portal: https://portal.plumvoice.com/hc/en-us/community/topics

Can a field have multiple prompts?

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
srmoser430
Posts: 20
Joined: Thu Oct 19, 2017 3:40 pm

Can a field have multiple prompts?

Post 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

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

Re: Can a field have multiple prompts?

Post 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

srmoser430
Posts: 20
Joined: Thu Oct 19, 2017 3:40 pm

Re: Can a field have multiple prompts?

Post by srmoser430 »

Thanks for your help!

Post Reply