How to use one line of code to add data in datatables

Hello all
Can anyone please tell me how do i add data into datatables instead of using AddDataRow()activities?

Thank you.

why not use add data row?

do you have an example of what youre trying to do?

Here is the example which i used Add Data row in my project.


I need to pass without empty values to data, is there any single line of code to add data into data table.

like this

  1. create newRow variable (type=datarow)
  2. assign newRow = dt.newRow
  3. now assign column value to new row e.g.
    newRow(“Column1”) = “Test”
    now column1 for newRow = Test, and all the other columns for newRow = blank by default
  4. use add datarow, and pass in newRow

Hi

I have tried this code. its working fine . is this possible inside the loop?
I have tried with 2 or 3 values its replaced the data, it didn’t apend the data.can you please tell me what code should i use if i need to append the data as well?

can you send your xaml here

all these steps must be inside the loop
image

@divya.paul You can also add entire row data at once to the data table without using any assign activities. If you want to add 2 rows in the data table then it is fine to take Add Data Row activity 2 times and insert the whole row of data at once. Please find attached workflow below

Example1.zip (3.1 KB)

Output

Capture1

If you want to insert more than 3 rows then you can use while loop

Capture3

Hi All

Thank you so much. Its working fine.

Hi

Thank you so much. its working fine.