Insert Tags within a ForEach Tag

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

This is important because 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

The following is an example for a simple forEach loop:

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

To insert a tag within a ForEach tag:

  1. Click in the cell where you want the tag to appear and click the Tag Builder icon. 
  2. Click the Tags tab and click the <Out> Tag icon.
  3. Click the Select tab.
    In the left pane, click the + sign next to the <ForEach> tag var name that you created  to expand it.
    Drag the data subgroup into the Select Bar. Note: Be sure to drag and drop the correct  data subgroup, as there may be multiple ones listed in the left pane. Drag and drop the data subgroup from the ForEach var, not from the main data source listed below it.
  4. Evaluate the data by clicking the Evaluate button.
  5. Save the tag.