Skip to main content
Cadet | Tier 2
February 24, 2023
Question

Struggling with Dates in bot using Automation Anywhere Community Edition

  • February 24, 2023
  • 18 replies
  • 1243 views

Hello,

I am busy building a concept bot, but I am having a problem with one component.

 

Basically, I want the bot to loop through an excel sheet and look at the renewal dates for certificates in a specific column.  If the renewal date is 9 days before the system date, it should give the user a message to say that the certificate is due to expire and needs to be renewed.

 

I've tried searching for a possible solution, but to no avail.

 

Could you perhaps please assist?

    18 replies

    Navigator | Tier 3
    February 24, 2023

    @anjelics. Could do it with Excel formulas after making sure the specific column of dates is formatted as dates. B2 | =A2<=(TODAY()-9)

     

    anjelicsAuthor
    Cadet | Tier 2
    February 24, 2023

    Thank you Steven440, but I was hoping to build a bot that could do it, and not have it be an exercise done in excel.  Just to show a quick concept to my boss about what a bot could do.

    Padmakumar
    Premier Pathfinder | Tier 7
    Premier Pathfinder | Tier 7
    February 24, 2023

    Hi @anjelics ,

     

    You can use the Datetime package for the same and use the Subtract action from it. Select Time value to subtract as 9 and select Days from Time unit to subtract drop-down list. Later on, convert this to a string variable using Date to String action and use that to compare with your excel data.

     

    Padmakumar
    anjelicsAuthor
    Cadet | Tier 2
    February 24, 2023

    Thank you @Padmakumar.  I have this in one of my steps, but seems like I'm doing something wrong.
    And I think the issue lies somewhere in the first step.
     



     

     

     

     

    Padmakumar
    Premier Pathfinder | Tier 7
    Premier Pathfinder | Tier 7
    February 24, 2023

    Thank you @Padmakumar.  I have this in one of my steps, but seems like I'm doing something wrong.
    And I think the issue lies somewhere in the first step.
     



     

     

     

     

     

    Are you getting any error while executing this BOT?

    Padmakumar
    anjelicsAuthor
    Cadet | Tier 2
    February 24, 2023

    Yes, I am.

     

     

    Padmakumar
    Premier Pathfinder | Tier 7
    Premier Pathfinder | Tier 7
    February 24, 2023

    Yes, I am.

     

     

     

     

    You are referencing the Column index in wrong format. 

     

    If you are using index to fetch the data, then use $Record[IndexNumber]$ format.

    If you are using the column name to fetch the data, then use $Record{ColumnName}$ format.

    Padmakumar
    anjelicsAuthor
    Cadet | Tier 2
    February 24, 2023

    Thank you.  I took your suggestion.  Now I get this error
     


     

    Padmakumar
    Premier Pathfinder | Tier 7
    Premier Pathfinder | Tier 7
    February 24, 2023

    Thank you.  I took your suggestion.  Now I get this error
     


     

     

    Check what is the format showing for the System variable CurrentDate. Mention the same format in line 4 under Custom format portion. Otherwise, you will get the same error. If you need, later on, you can specify the date format which you actually want while converting the date time variable to String.

    Padmakumar
    Raul Jaimes
    Navigator | Tier 3
    February 24, 2023

    @anjelics ,

    Set in a message box the output from Excel[7].

    Let us know the result.

    Regards