Looping over two lists at the same time

Hi all,
I have a condition where i need to loop over two different document lists at the same time -
Say FileList and another AccountList
Is it possible to loop over FileList & AccountList at the same time such that i can work with -
FileList[0] & AccountList[0] and then
FileList[1] & AccountList[1] and so on.
Both the list counts will always be the same.

Thanks for the help.
Shantanu

You can loop over one of them and use the pipeline variable $iteration to access an element of the same index from the other document list.

Shubhro

Thanks Shubhro.
I tried making it work the way you explained. But it works if we have a ablsolute vlaue for the index.
Suppose i look over FileList
and try to acccess the firts element of AccountList
these variable substitutions do not work –
%AccountList[$iteration]%
%AccountList[%$iteration%]%

But if i try %AccountList[0]% - this works.
where did i go wrong … or is it possible to do recursive variable substitution in webMethods.

Thanks
Shantanu

Try this:
Loop over FileList.
Create a map step. Map from AccountList to any element you want in the pipeline. Since you have not looped over AccountList yet you should see something called “indices” in the property window. Edit that and say $iteration.
let me know if this works.

Shubhro

What version of IS/Developer are you using? The ability to use variables for array indices was introduced with Developer 6.1, I believe.

Mark

Thanks Shubhro !!
It worked like a charm.

Mark, I am using IS/Developer version 6.1. So i could use the feature mentioned by Shubhro. Thanks a lot for your help.

Shantanu

Hello,

Yemi Bedu