Problem iterating with a for each loop

Hello to everyone!!

I’m used to working with loops, but this time, something is happening and I can’t understand why.

Here my sequence:

1 - Collecting data from AS400 with this structure:


Converting it into an Array List


Now I’m trying to iterate over it


The Output is:

Why the name is not coming up?
The message box is only sending to me the variable type.

What I’m missing here?

Thank you


In the final message box mention as


We need to mention the index

Cheers @Andre_Vieira


adding toString() to variable of datatype Array(Of xxx) will return the datatype info

In case of you want the to display the content of the array you can do following:
String.Join(" | ", YourArrayVar)

feel free to replace the " | " by any string used as seperator. With Environment.NewLine the items can be seperated within new lines (Linebreaks)

In case of inspection, if the implementation is working as expected we would suggest to work with debuging, brekapoints, locals/watch/immediate panel as trained in the Debugging course from the UiPath Academy

1 Like

Hello Dear Palaniyappan

I tried it

This is the current output:

Ok, is better the receive System.String ahahah

What I’m doing wrong?

1 Like

I got it

In the assign just keep like this

Remove .Tostring


1 Like

as described above

1 Like




See there are either two way

If you want to keep the NomeOutout as a string then expression should be like this

NomeOutout = Split(item,”;”)(1).ToString

Better mention this inside the for each loop as I believe you have kept NomeOutout as string variable
And just mention as NomeOutout.ToString in message box


If you have kept the NomeOutout variable type as array of string then expression will be

NomeOutout = Split(item,”;”) and continue in the same way as you have now

Cheers @Andre_Vieira

1 Like

Hello dear ppr.
Great explenation.

Let me see if I can solve it with Palaniyappan. If can’t I’ll try it in your way :wink:

My Dear!

It worked exactly how I want it.
Thank you a lot for your time.

Have a nice day


This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.