Deleting multiple columns inside a datatable

Hi,

I’m trying to delete some columns inside a data table - which is the output variable from read range activity - before writing the data table into CSV File. I only need some specific columns in the CSV file.
What would be best way to do that? Please suggest.

@ppratz

Download and install below package and then use Select certain Columns activity to read certain Columns. You need to pass DataTable and required Column names in Array of a string format.

Eg. {“Column 1”,“Column 2”,…“Column N”}

1 Like

Hi @ppratz,

you can simply mention columns you require or you want remove in Filter Data Table activity, as shown in below shot,

image

You can use above highlighted radio buttons to particular apply action.

1 Like

Hi @samir,

Can we mention all the column names(Column1,Column2,Column3 …etc )under one column value?
If so please tell me how can i do that?

@ppratz
Nope, you have to click on plus (+) to add more column names… as shown in below image.
image

Instead of adding more no of columns, if you want to remove 1 or 2 columns you can simply select remove radio button and mention columns which you want to remove from datatable.

1 Like

Thanks for the reply

Hello @lakshman , some time ago I saw that you could do something like this using assing and with the following sentence dtName.select ("[Column1] = ‘value’ AND [Column2] = ‘value’"). CopyToDataTable, could you explain to me what value go in [Column *] and in “Value”

@Juan_Esteban_Valencia

We will use this select query to filter Data based on some columns from DataTable.

For suppose I have input Data with Employee names, Department and Age. And want to filter data whose age is greater than 30 and Department is Finance.

                 dtOutput = dtInput.Select("[Age] > '30' AND [Department] = 'Finance'").CopyToDataTable

Note: If column name is single word then it’s not mandatory to keep Square brackets.

1 Like