Datatable add data row(s) to a new column

I am trying to fix a problem I have.

I have a datatable with 4,000 rows and a date format of 8/13/2022 11:35: 48 pm (mm/dd/yyyy hh:mm:ss) but what I need is (dd/mm/yyyy)

The data field name that I currently have is called “started” the new field can be called anything.

I can add a new column to the data table but not certain how to add the correct date to the new column

thanks

Hi @adrian_sullivan

Have a look on the thread, to change the Date format

Regards
Gokul

1 Like

not able to install the addin (corporate pc) so need to find another way

hi @adrian_sullivan,

How about loop for each row and use string manipulation (Split, substring etc) and get the data you need? but it takes time consider your row is 4k

the time part i dont mind - it is just getting the manipulated results back into the datatable that is what is causing me the issue

Hi @adrian_sullivan

You can try to convert the Date using CDate

CDate(CurrentRow("Column Name").ToString).ToString("dd/MM/yyyy")

Check out the XAML file

ChangeDateFormat.xaml (11.1 KB)

image

Output

Change Date.xlsx (7.1 KB)

Regards
Gokul

Hello again ,

here maybe you can try this workflow that i created
Excel_Filtering.zip (62.6 KB)

Hope fully this can help

that is giving me invalid file for when i try to open it

Have you check this below XAML file @adrian_sullivan

Regards
Gokul

hi all, i tried the solutions above and they didnt work for me.

i created a very mini version of the file that is the source of my data table.
what i am trying to do is get from 9/1/2022 7:21:55 AM to 9/1/2022 MM/dd/yyyy or even dd/MM/yyyy.
i can add a new column or update the current column either option is good.

image

source csv
Status,Task,Started
Pass,task 1,9/1/2022 7:21:55 AM,
Fail,task 2,12/24/2020 11:54:56 PM,
Pass,task 1,8/16/2021 4:04:15 PM,

thanks

hi @adrian_sullivan

You can try the modern method in the below thread

Regards
Sudharsan

Hi @adrian_sullivan

Check out the Updated XAML file

ChangeDateFormat.xaml (11.2 KB)

Output

Change Date1.xlsx (7.1 KB)

Regards
Gokul

1 Like

Output result

image

i have it working on a pc i have here with a new version of uipath. when i run it on my work pc with an older version of uipath i get an error about converting object to string.
very frustrating…

*** found the issue there was blank values in some of the rows. removed them and it works ok now

thanks

one more issue if i want to filter using date on this field what is the best way to do that. at the the moment if i run something like started > 14/08/2022 i am not getting any data back

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