Question

"An exception occurred while parsing the date time" in the course "Implementing Back Office Automation Using AARI

  • 23 February 2022
  • 11 replies
  • 859 views

While I was following the steps in the training course on "Implementing Back Office Automation Using AARI", I got this error "An exception occurred while parsing the date time". I tried to change the date format for the "Datetime: Assign" and also the datetime in the "If" condition, but I still encountered the same error.

 

I read from other posts that a "Datetime: To String" action might be needed, but I'm unsure how to make it work or if it's even needed for this case.

 

I have attached all the relevant screenshots for this task bot below.


11 replies

Userlevel 4
Badge +7

Hi @Prancia Toh​ ,

 

Could you try displaying the Excelrow[2] in a message box?

The syntax has to match with how it is coming from Excel, or more specifically, how the Bot interprets it.

 

Kind Regards,

Ashwin A.K

Hi Ashwin,

 

Message box? The Excelrow[2] variable was created for the Loop action in line 3 as shown in the screenshot below. [2] is the second index value for the variable itself.

Userlevel 4
Badge +7

Hi @Prancia Toh​ ,

 

I meant to say, could you display the value in a message box like so:

 

image 

This is to check what format the date is in, so that when we perform the date conversion, we will know the syntax.

 

Kind Regards,

Ashwin A.K

Userlevel 4
Badge +7

Hi @Prancia Toh​ ,

 

Could you toggle it over to Custom Format and pass in yyyy/MM/dd?

 

Kind Regards,

Ashwin A.K

 

Hi Ashwin, here is the format:

 

. 

Hi Ashwin,

 

I tried keying in yyyy/MM/dd in Custom Format for Datetime: Assign, and now this message appears:

 

.My local session/session name has always been "Default" all this while though.

Userlevel 4
Badge +7

Also I have noticed that you are deleting the first row, that isn't necessary if you check "Contains Headers" in the Excel Advanced: Open Action.

 

By doing so, the bot understands that the first row contains the Headers, which means you can reference them using the Header names itself like so:

 

$ExcelRow{Date}$ -> Notice the brackets are not square, but curly.

$ExcelRow{"Invoice Number"}$ -> Notice that the header is contained within double quotes, this is done since the header contains spaces.

 

Kind Regards,

Ashwin A.K

 

 

Userlevel 4
Badge +7

Hi @Prancia Toh​ ,

 

Could you verify whether the Session name provided in the Excel Actions and the Loop Action are the same?

If you have provided 'Default" in Excel Actions, please check if the same "Default" has been provided in the Loop Action as well.

 

If the issue persists, please share few screenshots of the workflow so that we may be in a better position to assist you.

 

Kind Regards,

Ashwin A.K

I figured out how to solve the error at line 3. I just need to bring the Excel Advanced: Close action outside of the loop.

 

. 

Now the bot is able to run successfully. Thanks for the suggestion on checking the format of the date!

 

Thanks for this information. I didn't know about this.

Badge

Strange, am facing the same issue and Excel close action is already out of Loop action. Attached snap.

Can anyone help on this? 

Reply