Skip to main content
Navigator | Tier 3
December 19, 2022
Question

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

  • December 19, 2022
  • 7 replies
  • 502 views

Hello,

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

Pradeep Kintali
Most Valuable Pathfinder
Most Valuable Pathfinder
December 19, 2022

@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

Raul Jaimes
Navigator | Tier 3
December 19, 2022

@harperjg ,

Try to use the custom format in DataTime package

Example:

 

HTH

Regards

harperjgAuthor
Navigator | Tier 3
December 19, 2022

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! 

Cadet | Tier 2
December 19, 2022

Hi

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

 

harperjgAuthor
Navigator | Tier 3
December 19, 2022

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! 

Most Valuable Pathfinder
December 19, 2022

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

Chand
harperjgAuthor
Navigator | Tier 3
December 19, 2022

Yep, got it:

Thanks All! :-)