Rearrange columns in an Excel spreadsheet

Hi, how do I rearrange columns in an existing Excel spreadsheet?

Hi,

You may use Sort table or data table activity.

Hi @DEATHFISH

It can be done. Check the following post on rearranging datatable columns…

Let know whether it works

1 Like

Hi, I want to rearrange the columns in a custom order instead of sorting by rules, how do I do this?

Hi @DEATHFISH

You want rearrange the column positions right. For Example : if there three columns 1.Name,2.Address and 3.Number you want change like 1.Address,2.Number,3.Name.

if the above mentioned is your case then you can use setOrdinal method in invoke and do that.

and there is custom activity available for this which you can use below mentioned is the link.

Regards,
ShivaKarthik

Hi @Shiva_Karthik

Thanks, how do I rearrange the columns using custom code?

HI @DEATHFISH,

You don’t need to use custom code instead you can custom activity,and provide the required inputs as shown in the below screen shot.

To install this activity go to package manager in all packages search for set ordinal activity yo will get it.

image

Another wise you can use invoke method and use setOrdinal method in that and provide the input parameters in parameters field in properties either of the ways should work.

image

In the target object give datatable.column(index of column you want to move and in parameters give the newindex)

Regards,
ShivaKarthik

1 Like