I was trying to swap my columns in a generated Excel file in the same workflow and I was trying to use invoke method for it. It’s showing error as “Value cannot be null”.
In image shown,I am trying to swap my second column to first and first to second.
And could we use it swap multiple columns?
I am attaching the screenshot of the same. And the variables used in it.
Thank-you
FilteredData.Columns(1) e.g. for reposition the second column?
Ensure FilteredData is valid and not null
once the second sol is repositioned to first postion, the original first col will be already on second position.
not with the SetOrdinal Method.
Give a try on this (Assumption Datatable defines 4 cols):
DtReordered = yourDataTableVar.DefaultView.ToTable(False,{“Col2”,“Col4”,“Col3”,“Col1”})
Thanks @ppr
I used FilteredData.Columns(“Value Date”) therein, as I wish to move one of my section Value Date to the first position. Should I use Index number there?
Yes, I am getting an output for filtered data
Hi @ppr
Correct me if I am wrong, Did you meant this(attached image)to use in place of SetOrdinal method? Getting an error
The coulmn names i put in here are as I wish them to be swapped