Insert column between column?

I want to need insert column in datatable (between column in old datable).

Please guide me about it.

Hi @fairymemay

kinly refer this link

hope this helps

@nikhil.girish If I want insert more than 1 column ?

use invoke twice one after another @fairymemay

@nikhil.girish If I want add column Remark in column D.

My code as below.

How to solve error ?

1 Like

Hello,
You can use Add Data Column activity to insert a column and use an Assign to set the order of columns in the data table as you want. I created one example. Hope it helps
InsertingColumn.xaml (7.5 KB)

Remove that “D” which is showing an error and try to run the bot

do you need a sample @fairymemay

@nikhil.girish yes.

Insert datatable.xlsx (17.4 KB)

My header data table now and expect as attached.

can you guide me where you want to insert the column

@nikhil.girish in highlight pink sheet New Datatable.

i can see there are too many columns you need to add
let me give you an another method

or will try to use invoke since i can mention ordinal bit easily

1 Like

@nikhil.girish Can you guide about flow?

Hey @fairymemay

Just replace the D with number 3

And repeat the same for next column with index value

Thanks
#nK

1 Like

InsertColumn_sample.xaml (7.8 KB)
please find the attached sample
@fairymemay
have created 2 columns

Thanks

1 Like

Hi @fairymemay

You can try with modern activities

Use Excel process Scope Activity and Use Excel file activity

Give the Excel file path

Use Insert column activity

Range → Excel.Sheet(“SheetName”)

Where → Before or After the column

Relative Column → After or Before where to add the new column

Add Header → Column Name

Regards
Gokul

1 Like

@nikhil.girish I create new invoke method by copy previous method but change value and TargetObject.

But error as below.
image

Don’t create you might miss some parameters @fairymemay

Instead copy paste invoke and later edit accordingly

@nikhil.girish I create new invoke but same error.

No dont create @fairymemay

Copy paste invoke code from previous step and edit it