Date as trigger for bot

Hi all,

I have the following question. I use data scraping to get a datatable out of a webpage.
However, I want the bot to only take the rows into account for which the data (YYYY-MM-DD HH:MM) is more recent then the data I run the bost last time.

  • How do I compare it with the date it ran last time? We are not using Orchestrator. For example if I ran the bot at 2018-09-26 10:25 it would only have processed the bottom item. If I want to run the bot again today, it should only process the 3 top ones.

Thanks in advance
Kind regards

image

To parse the String to a “DateTime” you can use:

DateTime.ParseExact( YOURSTRING ,“yyyy-MM-dd HH:mm”,System.Globalization.CultureInfo.InvariantCulture)

with this you can compare the date with the last date you started your robot:

DateTime.Compare(oldDate, newDate)

See: https://docs.microsoft.com/en-us/dotnet/api/system.datetime.compare?redirectedfrom=MSDN&view=netframework-4.7.2#System_DateTime_Compare_System_DateTime_System_DateTime_

To get the last started date of your robot i think you have save it somewhere like in a file.