Multiple choice technology packaged enterprise solutions

When processing a For loop or iterating over a Value List or Page List, which standard parameter would you inspect to get the value of the current iteration?

  1. pyIterationNumber

  2. pyForEach

  3. pyForEachCount

  4. pyCount

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

During loop execution over a list, Pega automatically stores the current iteration index in the standard parameter pyForEachCount. The other parameters like pyIterationNumber, pyForEach, and pyCount do not exist as standard loop counters in Pega's engine API, making them incorrect.

AI explanation

To answer this question, you need to understand how For loops work in the context of a Value List or Page List.

When processing a For loop or iterating over a Value List or Page List, you can inspect the standard parameter "pyForEachCount" to get the value of the current iteration.

Let's go through each option to understand why it is correct or incorrect:

Option A) pyIterationNumber - This option is incorrect because "pyIterationNumber" is not a standard parameter used to get the value of the current iteration in a For loop or when iterating over a Value List or Page List.

Option B) pyForEach - This option is incorrect because "pyForEach" is not a standard parameter used to get the value of the current iteration in a For loop or when iterating over a Value List or Page List.

Option C) pyForEachCount - This option is correct because "pyForEachCount" is the standard parameter used to get the value of the current iteration in a For loop or when iterating over a Value List or Page List.

Option D) pyCount - This option is incorrect because "pyCount" is not a standard parameter used to get the value of the current iteration in a For loop or when iterating over a Value List or Page List.

The correct answer is C) pyForEachCount. This option is correct because it is the standard parameter used to get the value of the current iteration in a For loop or when iterating over a Value List or Page List.