Skip to main content
Skip table of contents

If / Sub-action: Else

Tag: Else


The Else function only works if it comes directly after an </if> tag. Any tags put between </if> and <else> will generate an error and actions within the <else> block will only be executed only if the <if> condition is evaluated as false.

XML
<else/>

Example Script

XML
<ytriaAutomation>
	<if Test="SelectionCount" Mode="Equals" Value="0">
		<MsgBox Title="Warning" Message="If 1" Type="Warning"/>
	</if>
		<else>
		<MsgBox Title="Warning" Message="Else 1" Type="Warning"/>
	<if Test="SelectionCount" Mode="Equals" Value="0">
		<MsgBox Title="Warning" Message="If 2" Type="Warning"/>
	</if>
		<else>
		<MsgBox Title="Warning" Message="Else 2" Type="Warning"/>
	<if Test="SelectionCount" Mode="NotEquals" Value="0">
		<MsgBox Title="Warning" Message="If 3" Type="Warning"/>
		<if Test="SelectionCount" Mode="Equals" Value="0">
		<MsgBox Title="Warning" Message="If 4" Type="Warning"/>
	</if>
	<else>
		<MsgBox Title="Warning" Message="Else 3" Type="Warning"/>
	</else>
	</if>
	</else>
	</else>
</ytriaAutomation>


XML
<ytriaAutomation>
	<if Test="SelectionCount" Mode="Equals" Value="0">
		<MsgBox Title="Warning" Message="If 1" Type="Warning"/>
	</if>
	<else>
	<MsgBox Title="Warning" Message="Else 1" Type="Warning"/>
	<if Test="SelectionCount" Mode="Equals" Value="0">
		<MsgBox Title="Warning" Message="If 2" Type="Warning"/>
	</if>
	<else>
	<MsgBox Title="Warning" Message="Else 2" Type="Warning"/>
	<List name="Doc" Action="Load" Database="AutoTest\lm_us_8.nsf" Server="ytest-MD/TESTING"/>
	<List name="DocA" Action="Load" Database="AutoTest\lm_nab_8.nsf" Server="ytest-MD/TESTING"/>
	<List name="Doc" Action="Load" Database="AutoTest\custinfo_s03.nsf" Server="ytest-MD/TESTING"/>
	<List name="Doc" Action="Load" Database="websecuritystore.ntf" Server="ytest-MD/TESTING"/>
	<List name="Doc" Action="Load" Database="YtriaLogFile-2013-03.nsf" Server="ytest-MD/TESTING"/>
	<loop list="Doc">
		<if Test="SelectionCount" Mode="Equals" Value="0">
			<MsgBox Title="Warning" Message="If 3" Type="Warning"/>
		</if>
		<else>
			<MsgBox Title="Warning" Message="Else 3" Type="Warning"/>
		</else>
	</loop>
	</else>
	</else>
</ytriaAutomation>





JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.