How to insert rows dynamically in datatable after each iteration

Hi All,

I want to insert rows dynamically into a another datatable after each iteration done from the initial datatable.
For example: X datatable has 5 rows retrieved from a query . For each loop has been iterated over X and I need to put all the processed rows in another datatable Y. And send that Y datatable to business as a report in the email.

Can you please tell me the approach of how to insert those X data into Y datatable. I am really stuck in this.

@ksrinu070184 , if you could help me in this or anyone in the community.

Thanks.

@Arabinda_Das

Use a build Datatable with required columns with Datatable Y

You can use ForEach row for X datatable

Save all your data to different variable as below
Eg: Name = row(“ColumnName”).ToString etc.,

Once you saved all the variables and assigned, then use Add Data Row activity

here you can use Datatable Y and pass the variables

Hope this helps you

Thanks

Thanks for the response @ksrinu070184. It was really a help.
Do you know how to attach the datatable in the email body. I am passing directly the datatable, it is not working. Can you guide me with this as well ?

Regards,
Arabinda

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