Skip to main content
Windward

Inserting Tags within a forEach Tag

Overview

This information is key to having the tags inside your forEach loop return the data you expect.

Why This is Important!

Inserting tags into a forEach loop in the way described below -- by using the relative select -- is critical. It has to do with how the information is stored in your data source, where (in the database model) each row of information is associated with a number of columns.

When you use the relative select, you're accessing the data the forEach loop is holding rather than the data directly from your data source. This ensures you call upon each row, in order.

You are NOT accessing the database (or other data source) each time. If you were to try to do so by telling the software to select a column that's stored in the database, you'd get the same row returned over and over again.

This holds true for other situations in AutoTag, such as when you use the Query tag.

The Basics

A simple forEach loop:

ForEachLoopWithOutTags.JPG

 

To insert out tags within this table, you must reference the forEach variable using ${variable.column}. Using “select column from table" does not work. Step-by-step instructions:

The Details

  1. Click in the cell where you want the tag to appear and click the Tags button on the AutoTag ribbon.
    Tags button.PNG
  2. Click the Out Tag icon to insert the Out tag in the current location.
     
  3. Be sure the Out Tag you just created is selected then click the Data Tree button on the AutoTag tab.

Data Tree button.PNG

  1. In the Data Tree, locate the forEach you want to pull data from. If you have multiple forEach loops in your template, be sure to select the data from the correct forEach using the variable name.  Click the desired data from the forEach to apply it to your Out tag value.

expanded data tree with captions.PNG

  1. Evaluate the Out tag to verify what data is being returned by clicking the Evaluate button.

Out tag evaluate.PNG

More Info

See the detailed Tag Building in Microsoft Word tutorial for more information.

  • Was this article helpful?