Unanswered question

How do I access array runtime variable elements?

I have a variable extractor with "Extract all occurences" set so that it creates an array variable in one step of my script.
I have been using the array in a loop in the following step of the script by using the ${variablename_${loop_counter}} syntax, but it turns out I need to do a text substitution for each value in the array first (substituting "+" for " " to create a valid URL).
I think I need to use a javascript step to do this, but can't work out how an array runtime variable can be accessed from the Javascript API.
Would something like
context.variableManager.variableName.forEach()
work?
Or context.variableManager.getValue("variableName").foreach()?

Steve H.
Steve H.

Steve H.

Level
0
1 / 100
point

Answers

Ian M.
Ian M.

Ian M.

Level
0
13 / 100
points

If you select to extract ALL occurrances then the system automatically generates additional variables:

<VariableName>_matchNr
<VariableName>_n
<VariableName>_n_gm
<VariableName>
<VariableName>_rand
<VariableName>_rand_gm

See the Reference guide -> Design -> Requests -> Variable Extractors section for explanation of these extra variables.