Add a manipulated datatable to a dataset

Hello All,

I want to manipulate my dataset.

I am adding my extraction result into a dataset, from that dataset, I replace values in ExtractionResultsDataSet.Tables(“tablename”).

I want to add the manipulated datatable back to the ExtractionrResultsDataset variable.

I tried using ExtractionResultsDataSet.Tables.add(“tablename”) but this cannot be assigned to a dataset.

Hi,

in this case, we need to use InvokeMethod activity as the following.

Can you try this?

Regards,

1 Like

Thank you @Yoichi I will try this and let you know

for initial adding we use the invoke method.

For replacing an already added datatable with another datatable(“ButSameTableName”) we do have different approaches.

Some forum members preferred:

  • delete the table from the DataSet,
  • Add the other DataTable under the same tablename.

As an alternate we can exploit, the references are kept for the datatable when using assign activity:

grafik

we assigned from DataSet our “Table1” DT to dtOld
Used dtOld for clearing
Merged new data from another DataTable dtNew to the empty dtOld
DataSet.Tables(“Table1”) will then have all and only the rows from dtNew. We omitted the deletion and re-addition of datatables from dataset

1 Like

Thank you again this worked.

1 Like

One last question, do you know a way how to pass the dataset into an extraction result? I added the new data table into the dataset but need to parse the dataset back into the extraction result variable.

Thank you, yes removed the original data table from the data set and added the new data table.

Hi,

If you modify the datatable instance which is added to DataSet, there’s nothing to do.

However, if you re-create datatable (even if same variable name), it’s necessary to remove previous one from the dataset then add new one etc as @ppr suggests.

Regards,

1 Like

Thank you for this, great abbreviation!

however, how would we convert the entire dataset into an extraction result? I want the extraction result variable of the modified dataset to pass into the data validation process.

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