Find newest date

Hello how can i make a function that checks if the projects its from the newest date?

I have a list of different jobs, and it can be several identical jobs. But the date would difference them.

So i want the robot to pick the job that has the newest date. How can this be performed ?

The date format its in a browser and its formatted like this 13/08/2019

You can turn you string into a date time and use that to compare
date1=Datetime.ParseExact(“13/08/2019”,“dd/MM/yyyy”,System.Globalization.CultureInfo.InvariantCulture)

change date(string) to date time and store in a table and then you can use sorting by jobs and order by date desc
so you will get latest jobs of each

Its the function called sorting by jobs ?

throws me an error cant convert string into date

Use a trim, as the string you’re getting from browser might have additional white spaces.

Hello I am trying to filter this one

You see the dates on the left side.

is it possible to just extract the date as an string ?

Hey,

check my answers from this thread: How to check and extract the most recent date and time

There are plenty of posts on the forum covering how to convert strings into datetime. Once you got that, the hard part is over.

Cheers, Lukas

How do i use trim ? One of the values has alot of white space

stringVariable.Trim

How do i convert a string into a datetime ? What i get from get text activity its 00/00/0000 assume thats the correct format. But want to know how i can make a function thats checks if there its more than one column then check next coumn to see if the date are more recent than the other one

A lot of people keep asking and a lot of people keep answering how to convert string into datetime. Just click and read a little. I send you a code snippet to work with. See my last linked post how to check for the most recent date.

Code snippet

I usually use check if format and date are valid with DateTime.TryParseExact(myDateString,myDateFormat,Nothing,System.Globalization.DateTimeStyles.None,sampleDate)
then actually parse it with
DateTime.ParseExact(myDateString, myDateFormat, System.Globalization.CultureInfo.InvariantCulture)

Otherwise I can recommend the academy courses to learn about automation basics like using a for each loop and stuff.