How to Print a list variable in Messagebox?

Hi UiPath,

How can I print my variable List in a Messagebox activity?

Attached is the project I am working on
Get10Rows.zip (3.4 KB)

I tried using the String.Join

Thank!

Hi @alvin.c.apostol26

Have you tried with this expression

String.Join(" ",YourList})

Regards
Gokul

Hello @alvin.c.apostol26 ,

To print a List Variable in Message box use :
String.Join(“,”,YourListVariable).ToString

Regards,
Rohith

Hi I am getting the data below:
image

Hi @Gokul001,

Yes I tried it already.

and its given me this output:
image

Thanks!

you can only show the message in message box having datatype string or integer, since you get a list of datarows you wont be able to show that in mesage box, to show that you better have to save it to a datatable and using output datatable convert the datatable to string and can view in message box

please find updated image below::
The out from output datatable is given to message box

Hello @alvin.c.apostol26 ,

Are you trying to display the datatable in message box?

Regards,
Rohith

@rohith.prabhu Yes I am :slight_smile: just want to see the data for testing

@alvin.c.apostol26 - try this it will work for u
string.join(System.Environment.NewLine, dt_YourDataTable.Rows.Cast(of DataRow).Select(function(row) string.join(“,”,row.ItemArray))))

Put this expression in Msg Box & replace dt_YourDataTable with your DataTable Variable.

Hi @alvin.c.apostol26

Have a look on the XAML file

Get10Rows.xaml (22.1 KB)

Result

image

Regards
Gokul

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