Read Excel File and automating a webpage (error while automating the dates)

Hi Guys,
I have a problem like when I read the excel date and put that data in a website.The date (year)fields are not correct.
2

This is the excel sheet data.

dateerror

1 Like

Can you show what code you used in Uipath

or
once you have read the Excel ,in loop use assign
To_date= new datetime
From_date- new datetime
To_date = Convert.todatetime(row(“To”).tostring).tostring(“dd.MM.yyyy”)
From_date = Convert.todatetime(row(“From”).tostring).tostring(“dd.MM.yyyy”)
then Assign To1 = To_date.split(".“c) and From1= From_date.split(”."c)

then in website you can give
for From date
To1(0).tosring - will give date
To1(1).tostring- will give month
To1(2).tostring - wil give year
Similarly for From

hope it helps

Regards
Shanmukh

These are all the screen shots

1 2 3 4

@abrarsyed612
First thing:- Can you check in read range if the add header checkbox is checked
and check if “Month”, “Date”,“Year” are columns of excel

and show the error screenshot too

Regards
Shanmukh

The add header checkbox is checked.

check if “Month”, “Date”,“Year” are columns of [excel] I can’t understand this one.

@abrarsyed612 in your Excel sheet as date has column From And To right
So in Type into You can’t give row(“Date”).tostring directly unless you have a Date as column header in your excel sheet .

Do this:
To_date= new datetime
From_date- new datetime
To_date = Convert.todatetime(row(“To”).tostring).tostring(“dd.MM.yyyy”)
From_date = Convert.todatetime(row(“From”).tostring).tostring(“dd.MM.yyyy”)
then Assign To1 = To_date.split(".“c) and From1= From_date.split(”."c)
in Type into ,
For Date typeinto activity of To give To1(0).tosring
For Month typeinto activity of To give To1(1).tosring
For Year typeinto activity of To give To1(2).tosring

For Date typeinto activity of From give From1(0).tosring
For month typeinto activity of From give From1(1).tosring
For year typeinto activity of From give From1(2).tosring

Regards
Shanmukh

Where I must type this one. just now only iam started learning uipath.

To_date= new datetime
From_date- new datetime
To_date = Convert.todatetime(row(“To”).tostring).tostring(“dd.MM.yyyy”)
From_date = Convert.todatetime(row(“From”).tostring).tostring(“dd.MM.yyyy”)
then Assign To1 = To_date.split(".“c) and From1= From_date.split(”."c)

That should be inside For Each Row loop

This should be type here ah.

can you share your number for that I can asked these related queries.

Are you there…
This should be type here ah.

That should be inside For Each row , under body and before Type into input Ssn
you need to pull
To_date= new datetime ''For this pull assign activity from activity panel and assign value as shown , To_Date will be of datetime
From_date- new datetime '‘For this pull assign activity from activity panel and assign value as shown From_Date will be of datetime’
To_date = Convert.todatetime(row(“To”).tostring).tostring(“dd.MM.yyyy”) 'For this pull assign activity from activity panel and assign value as shown ’
From_date = Convert.todatetime(row(“From”).tostring).tostring(“dd.MM.yyyy”) For this pull assign activity from activity panel and assign value as shown ’
then Assign activity and give To1 = To_date.split(".“c) “To1 should be of type Array of string” and From1= From_date.split(”.“c) “From1 should be of type Array of string””

what is this?
then Assign activity and give To1 = To_date.split(".“c) “To1 should be of type Array of string” and From1= From_date.split(”.“c) “From1 should be of type Array of string””

this one is right ah

Yes Right expect last two
In last two it should be like this
get assign acitivity and give To1(Variable) = To_date.split(".“c) (To1 should be array of string in vairable panel)
get assign acitivity and give From1(variable) = From_date.split(".“c) (To1 should be array of string in vairable panel)

Then in existing type into of date,month, year you can add like this
For Date typeinto activity of To give To1(0).tosring
For Month typeinto activity of To give To1(1).tosring
For Year typeinto activity of To give To1(2).tosring

For Date typeinto activity of From give From1(0).tosring
For month typeinto activity of From give From1(1).tosring
For year typeinto activity of From give From1(2).tosring

see this we cannot create TO as a variable.

you can create to1 not to

I want to change the format like MM/DD/YYYY.

@abrarsyed612 you can do too … like instead of using Convert.todatetime(row(“From”).tostring).tostring(“dd.MM.yyyy”) use
Convert.todatetime(row(“From”).tostring).toshortdatestring or onvert.todatetime(row(“From”).tostring).tostring(“MM/dd/yyyy”)

Similarly for other too

1 Like

Iam getting the error like this.

My mistake :sweat_smile: That to_date and From_date should be of type String

Regards
Shanmukh

Again error is coming like this…