Copy date and change format dd.mm.yyyy

Hello, my robot is supposed to copy the date from Excel and paste it into the application. The format in Excel is: dd.mm.yyyy, but after pasting into the application, the format automatically changes to d/mm/yyyy - I added the sequence:

DateTime.ParseExact(CurrentRow(“column name”).ToString,“M/dd/ yyyy”,System.Globalization.CultureInfo.InvariantCulture).ToString(“dd.MM.yyyy”)

The robot enters the first date correctly, but when going to the second row, an error appears that the robot does not recognize the date d/mm/yyyy. How can I make the robot go through each rows, copy the date and paste it in the dd.mm.yyyy format?

Thank You!

have a look at the following firstAid and verify the formats

Later in the firstAid a strategy to fix it is demonstrated

Kindly note: ensure that no empty string will be parsed

Also have a look here:

within the description there are several inconsitencies mentioned related to the formats

1 Like

The format you provide here is the format of the string you’re converting, not what you want it to be converted into. You have to be very careful about extra spaces like you have before yyyy. If the source is dd.mm.yyyy then that’s what you put here: DateTime.ParseExact(CurrentRow(“column name”).ToString,“dd.MM.yyyy”,

Note that you have to use MM not mm. MM is months, mm is minutes.

@sullivanne

before reading the excel file can you try with this

!

in the range you can mention your column Range

cheers

Hi @sullivanne

You can try with date expression

DateTime.ParseExact(CurrentRow(“column name”).ToString.Trim,{"MM/dd/yyyy","M/dd/yyyy","dd.MM.yyyy"}, System.Globalization.CultureInfo.InvariantCulture,System.Globalization.DateTimeStyles.None).ToString("dd.MM.yyyy")

You can update the DATE FORMAT in the above expression : {"MM/dd/yyyy","M/dd/yyyy","dd.MM.yyyy"}

Regards
Gokul

Unfortunately, it does not work, I have this error, after entering the date from the second row. The first row typed correctly.

Have you add the necessary Date Format in the above expression? @sullivanne

DateTime.ParseExact(CurrentRow(“column name”).ToString.Trim,{"MM/dd/yyyy","M/dd/yyyy","d/M/yyyy","M/d/yyyy","dd/M/yyyy","dd.MM.yyyy"}, System.Globalization.CultureInfo.InvariantCulture,System.Globalization.DateTimeStyles.None).ToString("dd.MM.yyyy")
1 Like

Hi @sullivanne ,

image

I think the dd and MM are in single digit. So the robot can not able identify which is date and which is month.

Regards,


I’m doing something wrong :frowning:

Do you have any idea what I can do? :slight_smile:

Hi @sullivanne

Update the Double quotes in the expression that you have placed in the Type into activity

DateTime.ParseExact(CurrentRow("column name").ToString.Trim,{"MM/dd/yyyy","M/dd/yyyy","d/M/yyyy","M/d/yyyy","dd/M/yyyy","dd.MM.yyyy"}, System.Globalization.CultureInfo.InvariantCulture,System.Globalization.DateTimeStyles.None).ToString("dd.MM.yyyy")
1 Like

Thank you for helping me so much. The robot enters the date - from the first row correctly, from the second row instead of dd.MM.yyyy entered MM.dd.yyyy - dates in excel are entered in the same way. What could be the cause?

Use this expression to update the date for all the colums. Can you share the sample excel file?

Or else

you can try with Format cell activity

After that Use read range activity

Regards
Gokul

Hi @sullivanne ,
You can use
image
some case when we type into website, this text field change format of string you can use hot key and set a clipboard,
hope it help
regards,

@sullivanne

I think it would be better to share at least the screenshot of your workflow so we all can see how you build it :slight_smile: I suppose the solution is easy and there might just small mistake in the workflow.

Regards,
Kamil