Obtaining the current index of a page list or page group property

You can obtain the current index of a page list or page group property over which a rule is iterating by using the using the <current> and Top keywords. You can use these keywords in a rule type that has a Pages & Classes tab, such as an activity.

The index is a value that identifies one element (or member) of an aggregate data structure. For example, page lists contain an ordered list of pages, with each page identified by an integer value, starting with 1.

You can also obtain the current index value by using the <current> keyword with the page name instead of the Top keyword in a rule form, such as a data transform.

Obtaining the current index of a top-level page in an activity

When a rule iterates over a page group or page list property, you can use the <current> and TOP keywords to obtain a the current index of the top-level page over which a step in the activity is iterating.

For example, to obtain the current index of the of the pyNotes page list property, you can configure the activity with the following settings:

  • Add rows for the pyNotes property and the TOP keyword in the Pages & Classes tab.
  • Configure a loop to repeat over For each embedded page of the .pyNotes step page.
  • Configure the loop to use Property-Set method with the following properties and values:
    • Use the Local.Counter property with a value of Local.Counter + 1
    • Use the Top.pyNotes(<current>).pylabel with a value of "label" + Local.Counter

After you run the activity, the XML of the page displays the current index value of the pyNotes page over which you are iterating. For example:


      <pagedata>
      <pxObjClass>OJF777-MSApp-Work</pxObjClass>
      <pzStatus>valid</pzstatus>
      <pyNotes REPEATINGTYPE ="PAGELIST">
      <rowdata REPEATIONGINDEX="1">
      <pxObjClass>Data-WorkAttach-Note</pxObjClass>
      <pyNote>Note1</pyNotes>
      </pyLabel>label 1</pyLabel>
      </rowdata>
      <rowdata REPEATINGINDEX="2">
      <pxObjClass>Data-WorkAttach-Note</pxObjClass>
      <pyNote>Note2</pyNote>
      <pyLabel>label 2</pyLabel>
      </rowdata>
      </pyNotes>
      </pagedata>
      

Obtaining the current index of a page list or page group in a data transform

You can use the <current> keyword in a data transform to obtain the current index of the page list or page group property over which a step in the data transform iterates.

For example, to obtain the current index of the pyNotes page list property, you use the following actions:

  • The For Each Page In action with a target of .pyNotes
  • The Set action with a target of .pyNotes (<current>).pyLabel