How to insert a value to specific cell of datatable

Hi,

Is there any way we can insert a value to specific cell of existing row of a datatable.

My Requirement is like:

I have build datatable with two columns.
In one column I have fetched the details from scrapping.
In second column I want to add some different data (text/id) fetched from different source.

How can I achieve this. Please suggest.

Thanks,
Shenki

2 Likes

To answer your question, you’re going to do something similar to what you would do if you were searching for the information to do something with it like in this case: Using inequality functions in my conditional code

However, what you are doing is likely not the best way. Instead, you probably want to use a Dictionary<String, String> as that will be the fastest, most efficient means of storing and retrieving the data. Otherwise you’re having to iterate through an unsorted list, which is super slow. I would only suggest the DataTable way if you were planning on using the results as your TransactionData to create new TransactionItems to fill out the second column in the ReFramework if you are sure you have to go through that DataTable one at a time in order.

We can use a simple assign activity like this
Yourdatatable.Rows(rowindex)(“yourcolumnname”) = “your value”
Or
Yourdatatable.Rows(rowindex)(columnindex) = “your value”
Where row index and column index both starts from zero for first row and first column

Cheers @ShenkiSinghai

10 Likes

You are awesome. :slight_smile:

1 Like

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