Hi team,
how can i read a row from a datatable and put the element in an array?
Example:
client - name - last name
1,mia,contra
2,robert,landon
I want to read at first run the first row and put in a variables. Client = 1 Name = mia lastName = contra.
When transaction number increased (2) do the same operations but assign client = 2 Name = Robert Lastnmae = Landon
Thanks in advance
Hey @andreus91
Create array of strings(arrayData) and add data as following.
strong text
arrayData={row(“client”).tostring,row(“name”).tostring,row(“lastname”).tostring}
1 Like
inside the for each activity?
Because in this case if i try to do this the output will be
array
1,mia,contra
2,robert,landon
How can i put instead of for each row, only the row(transactionNumber)?
@andreus91 you can use
row.itemArray and it will put everything into array, but again this will not be store as key value pair.
1 Like
Thanks @Lakshay_Verma,
in REFramework the condition to go further is:
IF TransactionNumber < Datatable.rows.count in order to have 2 laps, one for each row of my datatable.
There are other possibilities to assign in 3 variables, when transaction number is 0 ID = 1, FIRSTNAME= Mia LASTNAME = CONTRA
and when transaction number is increased = 1 assign the variables with the value of the second row of my dt?
Use this condition
If
dt.rows.indexof(row)=transaction number
Assign
arrayData=row.itemArray
1 Like