Page 1 of 1

Do not re-prompt

Posted: Tue Sep 18, 2012 12:59 pm
by hecleal
I am prompting user for a secondary id, but most users will not be entering this secondary id. In the code below, its the last prompt and I want it to prompt the user for a client number, but only prompt once. If nothing is entered, I want to assign a value of zero and go on with the next line. Without the <noinput>, it keeps reprompting for the client number. With the <noinput> it seems to just get stuck in a loop of the following:

Tue 18 Sep 2012 01:52:29 PM EDT:received event: noinput: VXI::assign_element(name="ClientID" expr = "0")Entering form = 'FirstPart' form item = 'id'VXI::field_element - activating grammars for form = 'FirstPart' formitem = 'id'VXI::do_recognition()PromptManager::Play()

Code: Select all

<form id="FirstPart">
        <filled>
                <if cond="CalledID==3999">
                 <assign name="AgencyID" expr="281"/>
          
                <elseif cond="CalledID==8888"/>
                 <assign name="AgencyID" expr="281"/>
          
                <else/>
                 <assign name="AgencyID" expr="281"/>          

                </if>
        </filled>
        
	<block>
		<prompt>
			<audio src="wavfiles/spa1.mp3">
				Welcome to Visit Clock.
			</audio>
		</prompt>
	</block>

	<field name="ProviderID" type="digits">
		<prompt>
			<audio src="wavfiles/spa2.mp3">
				Please enter your employee ID using the keypad.
			</audio>
		</prompt>
	</field>
  
	<field name="id" type="digits">
		<prompt>
			<audio src="wavfiles/spa3.mp3">
				Please enter the client number using the keypad.
			</audio>
		</prompt>
		<filled>
			<assign name="ClientID" expr="id"/>
		</filled>
		<noinput>
			<assign name="ClientID" expr="0"/>
		</noinput>

	</field>
	<filled>
		<submit namelist="AgencyID CallerID ProviderID ClientID" next="http://blah/blah/blah" />
	</filled>
</form>
Please help.

Thanks,
Hector

Re: Do not re-prompt

Posted: Tue Sep 18, 2012 2:00 pm
by support
Hi Hector,

The issue you're currently running into is the "Form Interpretation Algorithm". Specifically what's happening is that the default behavior of the <noinput> is to reprompt the form for the missing input. Since the field "id" does not have any assigned value it will continue to request a value to be entered. There are two ways to avoid this. The first is to assign both ClientID and id within the noinput.

Code: Select all

          <noinput>
             <assign name="id" expr="0"/>
             <assign name="ClientID" expr="0"/>
          </noinput>
When the FIA attempts to reprompt the form it will fall all the way though past this collection point. Another way to avoid this issue is to explicitly jump to the next piece of code you would like to implement.

Code: Select all

          <noinput>
             <assign name="ClientID" expr="0"/>
             <goto nextitem="submit"/>
          </noinput>
       </field>
       <block name="submit">
          <submit namelist="AgencyID CallerID ProviderID ClientID" next="http://blah/blah/blah" />
       </block>
This will avoid the FIA scanning the entire form again looking for a collection point that does not have any assigned data. We would also recommend merging your first <filled> section with the first <block> section:

Code: Select all

       <block>
          <if cond="CalledID==3999">
            <assign name="AgencyID" expr="281"/>
    
          <elseif cond="CalledID==8888"/>
            <assign name="AgencyID" expr="281"/>
    
          <else/>
            <assign name="AgencyID" expr="281"/>         

          </if>

          <prompt>
             <audio src="wavfiles/spa1.mp3">
                Welcome to Visit Clock.
             </audio>
          </prompt>
       </block>
Hope this helps!

Regards,
Plum Support