You are here: Record management > Building expressions with the Expression Builder > Parts of aggregate property references > Examples of <current> keyword usage

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

You can obtain the current index of a page 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:

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: