Hi Plz give some Example on Out Array of Loop

Hi ALL

Could anybody plz give some Example on OutArray of the Loop and how it works.

Thanks
Sreekanth

Try building this service.

Svc Name: tryLoop
Svc input: inList (stringList)
Svc output: outList (stringList)

first statement: LOOP
LOOP property (inArray): /inList
LOOP property (outArray): /outList

second statement: MAP (indented under the LOOP)
connect PI variable (inList) to PO variable (outList) [note, within the LOOP both varables appear as type string, not stringList]

Run this service
Enter some values for inList
Observe that outList contains an entry for each entry in inList.
tryLoop.zip (3.97 KB)

Hi ladson

Thanks a lot ladson!

Hi,
In the inner loop i have given input as
“Ram Naresh”, then can u pls tell me how to take RAM & NARESH in two seperate strings, now it is showing the RAM in String[0] and Naresh in string[1] so when i take the two strings and map them i am getting NARESH in the both the strings.

thanks,
Hari

Hi Hari,
Can you post detail what did you do?

As per your post you have stringList[0]=RAM and stringList[1]=Naresh

Try something like:

MAP (init with blank a stringList variable called outStringList)
LOOP (inArray: /stringList; outArray: /outStringList)
—> MAP stringList to outStringList
MAP (placeholder). Here you should find that outStringList[0]=RAM and outStringList[1]=Naresh

HTH,
Bhawesh

Hi,
yes i am getting the same way but take two strings as firstname & lastname which are of type strings, now i want to map the output string list[0] to firstname and output string list[1] to lastname.

for ex:

Input string list:

inputstringlist[0] Ram
inputstringlist[1] Naresh

output string list:

outputstringlist[0] Ram
outputstringlist[1] Naresh

Now i want Ram in firstname and Naresh in lastname in which firstname and lastname are strings

Thanks
Hari

Hari,

If your output stringlist holds Ram and Naresh and you want to map to 2 seperate string variables then when you map link to firstname and lastname in link properties specify index[0] for Ram and [1] for Naresh then you should see the pipelineout as expected.

HTH,
RMG

Hi,
while i am using the loop i am getting the input stringlist as string with in the loop, so when i map the input stringlist to the firstname and lastname it is showing the zeorth element of the stringlist for both.

Thanks,
Hari
tryLoop.zip (4.26 KB)

Hi Hari,
When rmg suggested “map link to firstname and lastname in link properties specify index[0] for Ram and [1] for Naresh”.

Do this MAP step after you come out of the loop.

  • Bhawesh.

When you loop on stringlist then inside the loop you can map directly the strings firstname,lastname variables to the target variables the map link properties will not show any indexes it says fields not indexable.

How many fields are there in your stringlist? I am confused of your statements.

HTH,
RMG

Hi,

Thanks for ur help I got it. Actually I am splitting into three names (firstname, middlename, last name) but by mistake i have specified two name in the group.

Thanks,
Hari