Skip to main content
Windward

Else Tag Tutorial

Overview

The Else Tag, like the If Tag, allows you to display conditional information in your report. As you can see from the if tag tutorial, if the data retrieved via an <if> tag doesn't meet the condition in the template, the report displays nothing. But with the <else> tag, if the data retrieved doesn't meet the condition, you can tell the report template to display something else.

Keep in mind that an <else> tag is optional, and it is based on an <if> tag. You can have an <if> tag without an <else> tag, but you can't have an <else> tag without an <if> tag.

Instructions

Create the Else Tag

Click the last cell just after the word "PROMOTION" and click the Tag Builder icon in AutoTag. In the Tags tab, click the <else> tag icon, and click the Save Tag icon. Your table now looks like this:

EmployeeID

LastName

FirstName

Title

<Employees><EmployeeID>

<LastName>

<FirstName>

<Title = 'Sales Representative'>PROMOTION<else> :if>

:forEach>

Enter the text to be displayed

Now that the formatting of the <else> tag has been taken care of, you can enter the text you want displayed. Click the last cell immediately after the closing angle bracket for the <else> tag and type the phrase "sorry, no raise":

EmployeeID

LastName

FirstName

Title

<Employees><EmployeeID>

<LastName>

<FirstName>

<Title = 'Sales Representative'>PROMOTION<else>Sorry, no raise :if>

:forEach>

Run the report

You don't need to close the <else> tag, because the <endif> tag acts as its closing tag. Save your report template using Word's Save command. Then, from the AutoTag Run Report group, click the desired report format icon. In this example, we chose to view the report as a DOCX file, and this is the result:

File:Wiki/AutoTag/02AutoTag_Reference_Guide/03Tagging/Else_Tag_Tutorial/else_1.PNG

That's it! You've learned how to create <if> and <else> tags.

  • Was this article helpful?