Community articleDereferencing
Added by IBM contributorIBM on November 25, 2011
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

No abstract provided.

When making a reference to an item node, there may be times when you do not know which node to reference because it depends on some action from the user of the form. Consider a situation in which a user selects a cell from a list. Because you don't know beforehand which cell the user will choose, it is not possible to explicitly reference the item node for the chosen cell. In such cases you would use dereferencing to retrieve the node indirectly.
Essentially, dereferencing allows you to make a dynamic reference that is evaluated at runtime. This is accomplished by placing the -> symbol to the right of the dynamic reference.
For example, consider a list item called List1 that has three cells called Cell1, Cell2, Cell3. If you want to access the item node of the cell selected by the user, use the following reference string:

At runtime, the portion of the expression that is to the left of the dereference symbol is evaluated and replaced. If the user chooses the second cell, List1.value is evaluated and replaced with:

As a result, the item node for Cell2 is returned.
In some cases, instead of accessing the item node of the chosen cell, you may want to access one of the cell's option nodes. Again, dereferencing is used. The reference string would be:

As before, the above expression is evaluated at runtime. The expression to the left of the dereference symbol is evaluated and replaced, just as before. So if the second cell is selected, List1.value is evaluated as Cell2. This value is then concatenated with the expression to the right of the dereference symbol. This produces:

As a result, the option node for Cell2.value is returned.
Note: Do not include any spaces before or after the dereference symbol (->).
Parent topic:
About references