Delete rows containing the term "Cancelled" from datatable

Good day,

As you can see from my automation, I have been trying lots of ideas to delete data from my table, prior it going into Excel.

I have extracted data from a website, containing the word “Cancelled” in the 14th column (the column name appears to change frequently). I want this word to be removed from the DT prior to writing it into Excel.

In the Assign activity on the top, I currently get the "Cannot assign from type ‘System.Data.DataColumn’ to type ‘System.Data.DataRow’ in Assign activity ‘Assign Identify fields with “Cancel” to remove from table’.

I’m thinking to rather reference the column number in this Assign activity, than a col name. Current Value in there is SALESDATA_DSP_STR.columns(14).

1 Like

Hey @herman,

What does item.tostring print for you.

And please share the project file if possible.

Will be easy to resolve.

Thanks :slight_smile:

Hello herman,

I don’t know if I understood your problem correclty, but if you want to remove all rows containing “Cancelled” you can use Filter Table activity and select “Remove”.

image

1 Like

Thanks for the reply - we’ve decided to remove this portion of the code, refer below for solution.

Thanks Stefano, we’ve worked with your solution, and it works like a charm!

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