I want to add new column "Date"

Following columns are from Extract Data Table, I need to add date column. The rows are not certain but columns are fixed so Date should be written to number of columns are there.

@BHUSHAN_NAGAONKAR1,

You can add column by Add Data Column activity.

For this show some input data and what you are expecting.

Thanks,
Ashok :slight_smile:


This are th3 columns extracted by extract data table and I want to add date at start of the column on A1 how should I do it?

@BHUSHAN_NAGAONKAR1,

Here is the solution for this.

Solution:

Before rearranging the Columns:
image

After Rearranging the columns:

image

Sample Code:
GetText.xaml (10.6 KB)

Thanks,
Ashok :slight_smile:

1 Like

Hey @BHUSHAN_NAGAONKAR1

Take a Build Datatable Activity:
And Include all the columns you want as a output including Date Column at first!

Output of above activity: dt_Output

Use below LinQ in assign activity:

dt_Output = (
From row In dt_Input
Select dt_Output.Rows.Add(row.ItemArray.Prepend(Now.ToString("dd-MM-yyyy")).ToArray)
	).CopyToDatatable

Note: Replace dt_Input as Extracted Datatable, dt_Output is Output datatable with date column.
You can change date format according to your requirement by changing in the LinQ.

Input & Output with Dummy data:
image

Workflow Screenshot for your reference:

Attaching .xaml for your reference:
AddDateColumn_Sequence.xaml (13.4 KB)

Regards,
Ajay Mishra

1 Like

@Ajay_Mishra @ashokkarale Sorry for late and I ve got the answer

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.