Remove data column activity - bug?

Hello community,

I have implemented an automation where I created a 3 columns DT and 2 columns are populated via an Excel sheet.
The 3rd column is filled by the transaction items.

For the automation it is required to delete the first 2 columns after the transaction items have been processed.
I realized this with performing 2 times remove data column activity consecutively (always remove column index 0).

However, I noticed that sometimes (randomly) I get an error with get row item activity (where I read the items from the 3rd column which is now the one and only column). The problem is that sometimes the DT is completely empty. I did hours of troubleshooting and could not accept that it might be caused by the 2nd remove data column activity.

However, I tried a workaround where I put an if statement around the 2nd remove data column activity so that this activity is only performed when the column count is > 1.

I did some test runs already and the issue seems to be solved. But I don’t understand how sometimes more columns are removed than I set up.

Is it a known issue or a bug? I thought that performing 2 times the activity consecutively is ok and that a loop would be overpowered for removing only 2 columns.

Thanks

Hi @SenorChang

Using Remove Column activity two times doesn’t make any issue. But can you show how you are using those activities, take a screenshot and share with us.


Here you go. My assumption is that the activity runs too fast one after another. I don’t understand this behaviour and it is not logically.

Those 2 activities are identical…always remove the first column so that I don’t have to deal with column names.

Yeah might be… @SenorChang

Delete both remove column activity and try the below expression to keep only the third column in the datatable, use an assign activity

- Assign -> dt_Process = dt_Process.defaultview.ToTable(False, dt_Process.Columns(2).Column name)

Above expression will help to remove first two columns and keep only third column in the datatable.

It works very fast and perfect

Hope it helps!!

Use the Filter Data Table activity and set it to “remove” columns, and you can remove both column index 0 and 1 at the same time.

use ‘filter data table’ activity remove multiple colums in same time