Help with set text to return date in MM/DD/YYYY format

  • 19 December 2022
  • 7 replies

Userlevel 1
Badge +4


I am trying to do a set text action on web field to insert the current date in MM/DD/YYYY format. For example, if the bot ran today I need the set text action to write 12/19/2022 in the web field. Thanks! 

7 replies

Badge +3

@harperjg  - In DateTime package, there is a action ToString, you can convert your date into specified format and you can save in String. use this variable for SetText action

Userlevel 5
Badge +9

@harperjg ,

Try to use the custom format in DataTime package





Userlevel 1
Badge +4

Thanks @Pradeep Kintali , I have found that function but not sure how to use it in this case. Could you attach some screen shots showing how to do this? I am relatively new to Automation Anywhere and still learning where everything is in the app. Thanks! 

Badge +1


Use action Datetime to string

Source date & time variable: System:Date

Custom format MM/dd/yyyy

Assign output to string variable e.g. vTodayDate


Use variable in the web field


Userlevel 1
Badge +4

Oh, disregard @Pradeep Kintali you answered my question. I was at that point but did not realize that you could manually enter in a format. Thanks! 

Userlevel 6
Badge +16

Hi @harperjg 

Use String : Assign command provide System variables CurrentDay/CurrentMonth/CurrentYear under Source String, use this variable in the SetText action for passing the current date dynamically

Userlevel 1
Badge +4

Yep, got it:

Thanks All! :-)