How to set a date in web portal using excel date

Hi,

I have an excel file which contains dates, I want to set the date into a web portal from excel file. Can any one help me to do automation for it. Here I am share pics of excel file dates and Portal.

image

Regards,

Hi there,

First you need to convert the excel value from object/string into datetime object using DateTime.TryParse method. You may need a few of these in a nested Try Catch since the format is different (sometimes it’s dd-MM-yyyy, sometimes it’s dd/MM/yyyy).

Once converted to datetime data type, you can use a type into where the value is yourDateTimeVariable.ToString(“yyyy-MM-dd”).

Hello @raju_alakuntla ,
Initially you need to print the Dtae values as a Log message and identify the format of date.
Then use

Date_String=DateTime.ParseExact("10-12-2022","dd-MM-yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("yyyy-MM-dd")

Note: dd-MM-yyyy wiil change based on your format.

Use Typeinto activity and type in the Start date box with simulate type.

HI @raju_alakuntla ,

You can use the CDate Function, I tried to conver these format of dates using

CDate(currentRow(startDate).toString).toString(“yyyy-MM-dd”)
image

Thanks!

Happy Automation! :smiley:

where should i use CDate function? I am using read range and type into activities. Please guide me

Regards,

Hello @raju_alakuntla
can you give some details as format is fixed month-date-year or it chnge ?

It could be directly used in your Type Into Activity.

That would type it in the required format as shown in your screenshot.

Please mark as solution if this serves your purpose.

Thanks!
:smiley:

datetyping.xaml (13.4 KB)
Try use this. this only the option you have to check or uncheck preserve format of excel read range activity.
hope this helps.

hi @raju_alakuntla

Did it work, if so can you please close the topic by marking the solution that worked for you.

Thanks
Happy Automation!

Set Text ‘DIV’: Expression Activity type ‘VisualBasicValue`1’ requires compilation in order to run. Please ensure that the workflow has been compiled.

Getting this error.

Regards,

Try assigning this into a variable first and then pass that Variable into your type into activity.

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