How to print array of string in uipath

uiautomation
activities

#1

How to print array of string in uipath


#2

Hi @tgopalas,
You have to give the array variable in for each loop and print that value
refer this test.xaml (8.2 KB)


#3

Hi @tgopalas,

using for each activity inside the body content use log message to print the value in the output screen.

Regards,
Arivu


#4

@tgopalas
you can print the array of string in a line by seperating it with a delimeter like (comma etc)
use log message
Inside log try this
string.Join(",",List_Variable)

If you want to print each element in different line then use this
string.Join(System.Environment.NewLine,List_Variable)

Regards,
Mahesh


#5

Thank you @Ajithkumar_P


#6

Thank you @MAHESH1


#7

Thank you @arivu96


#8

Mahesh how can we find functions and syntax for each, like one you told to print on new line.

I’m unable to find these things at one place Please help


#9

@nikhil_rao

You can just search in Google and you should get good results. Like you can search for how to output an array.

Also, you don’t necessarily need to remember everything if you just learn a few basic concepts. Like for instance, if you know by typing Array followed by a period you get a list of functions; additionally, if you know you can type String and a period you can find the functions that can be used. And just the same, if you have a variable that is an array, string, or other types, by typing a period it will list all the functions you can use.

Once you find a function that could work, by typing a Parenthesis, it will show the properties that it needs inside the parenthesis (and there different properties that can be used for some by pressing the down arrow).

See some snippets below:
image
image

So it just comes from experience and learning the things that are most useful and you use a lot, because you won’t use everything.

You can remember to join any list to a string so you can output it to a variable, Message Box, or Write Line… well, you are forming a String and joining so it’s must be String.Join() then it will show you the properties it needs by typing in the parenthesis.

I hope that helps you. I don’t think there really is a good place to find these things. But, if there is a place that does and you like the resource then you can find it by searching on Google.

Regards.


#10

thanks but it becomes difficult for small small things to search, not like selenium where u can explore a lot.