Convert a Datarow to a string without the use of a loop (for each)

Hello,

I’m trying to convert a Datarow to a string without the use of a loop (for each).

Is there anyone that can help me?

Give a try at
strFlatten = String.Join(“|”, YourRowVar.ItemArray)

feel free to use any other column seperator char

2 Likes

Hi @Martin_Juel_Andersen

Welcome to UiPath community

Try with followings below:

  1. Use Build DataTable activity to create DataTable and say it as DTBuild
  2. Use Add Data Row activity and pass that DataRow and also enter the DataTable DTBuild.
  3. Use Output DataTable activity and it will convert DataTable into string.

Regards
Gokul

Convert it to a string for what purpose? Why are you trying to avoid For Each? There’s no reason to avoid it.

dt_variable.Rows(0).item(“”).ToString

dt_variabele is the name of your datatable.
the 0 in the rows is the first row, select what row you want to select and the item is to select what item you want from your datatable so you put a columnname to get the value of the cell.

Thanks, that worked!

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