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

if condition within catch block

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
sniemetz
Posts: 12
Joined: Thu Sep 02, 2010 2:18 am

if condition within catch block

Post by sniemetz »

Hello

I am trying to have conditional logic within a catch block - depending on whether values are set I want to fork the decision - however this doesn't seem to work.
Suggestions?

<field name="thisfield">
<catch event="connection.disconnect.hangup">
<var name="var1"/>
<if cond="typeof thisfield$ !='undefined'">
<assign name="var1" expr="'choice 1'"/>
<else/>
<assign name="var1" expr="'choice 2'"/>
</if>
<submit namelist="var1" .............. />
</catch>
</field>

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

Re: if condition within catch block

Post by support »

Hi,

You can certainly implement conditional logic within a catch block in your VXML code. The only issue we noticed with the code snippet you posted was that you must surround your <field> with a <form> such as:

Code: Select all

<form>
<field name="thisfield">
<catch event="connection.disconnect.hangup">
<var name="var1"/>
<if cond="typeof thisfield$ !='undefined'">
<assign name="var1" expr="'choice 1'"/>
<else/>
<assign name="var1" expr="'choice 2'"/>
</if>
<submit namelist="var1" .............. />
</catch>
</field>
</form>
Hope this helps!

Regards,
Plum Support

sniemetz
Posts: 12
Joined: Thu Sep 02, 2010 2:18 am

Re: if condition within catch block

Post by sniemetz »

AArrgh.

I will retry. Just noticed in Log that the values I am looking for ARE being set - I just omitted them from the submit namelist!

THanks for the prompt response.

s

Post Reply