Date format: String to Date

Hi, I am trying to convert String into Date, but I am getting this below error. Can anybody suggest, please?

Error executing DateFormatAction

com.workfusion.studio.rpa.recorder.playback.PlaybackException: Error executing TemplateAction[templateName=DateFormatAction.ftl,id=83,name=Optional[DateFormatAction],parent=54,nextSibling=84,arguments=ActionArguments[outputLocale=[en-US],outputMask=[h:mm:ss a],inputLocale=[en-US],xsi:type=[recorder:DateFormatAction, recorder:DateFormatAction],pollingInterval=[300],active=[true],inputMask=[MM/dd/yyyy a],input=[${aa_var_dt}],targetVariable=[aa_var_str],delay=[0],actionDetails=[Date & time check],direction=[STRING_TO_TYPE],awaitTimeout=[5000]]]
at com.workfusion.studio.rpa.recorder.playback.flow.StandardControlFlow.execute(StandardControlFlow.java:54)
at com.workfusion.studio.rpa.recorder.playback.action.template.TemplateAction.execute(TemplateAction.java:28)
at com.workfusion.studio.rpa.recorder.playback.action.template.TemplateAction.execute(TemplateAction.java:15)
at com.workfusion.studio.rpa.recorder.playback.player.ActionPlayer.next(ActionPlayer.java:64)
at com.workfusion.studio.rpa.recorder.player.PlaybackLogic.playNextAction(PlaybackLogic.java:152)
at com.workfusion.studio.rpa.recorder.player.PlaybackLogic.run(PlaybackLogic.java:112)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.time.format.DateTimeParseException: Text ‘9/6/2019’ could not be parsed at index 0
at java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:1949)
at java.time.format.DateTimeFormatter.parseBest(DateTimeFormatter.java:1897)
at com.workfusion.studio.rpa.recorder.api.internal.representation.RDateTimeRepresentation$CustomRepresentation.parse(RDateTimeRepresentation.java:140)
at com.workfusion.studio.rpa.recorder.api.internal.representation.RDateTimeRepresentation.getValue(RDateTimeRepresentation.java:53)
at com.workfusion.studio.rpa.recorder.api.types.RDateTime.fromRepresentation(RDateTime.java:104)
at com.workfusion.studio.rpa.recorder.api.types.RDateTime$fromRepresentation$0.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:136)
at Script58.run(Script58.groovy:8)
at com.workfusion.studio.rpa.recorder.playback.shell.GroovyShellWrapper.executeScript(GroovyShellWrapper.java:48)
at com.workfusion.studio.rpa.recorder.playback.player.PlaybackContext.executeScript(PlaybackContext.java:65)
at com.workfusion.studio.rpa.recorder.playback.action.template.TemplateAction.executeBehavior(TemplateAction.java:33)
at com.workfusion.studio.rpa.recorder.playback.flow.StandardControlFlow.execute(StandardControlFlow.java:46)
at com.workfusion.studio.rpa.recorder.playback.action.template.TemplateAction.execute(TemplateAction.java:28)
at com.workfusion.studio.rpa.recorder.playback.action.template.TemplateAction.execute(TemplateAction.java:15)
at com.workfusion.studio.rpa.recorder.playback.player.ActionPlayer.next(ActionPlayer.java:64)
at com.workfusion.studio.rpa.recorder.player.PlaybackLogic.playNextAction(PlaybackLogic.java:152)
at com.workfusion.studio.rpa.recorder.player.PlaybackLogic.run(PlaybackLogic.java:112)
at java.lang.Thread.run(Thread.java:745)

Hi @sambit_pattnPr.

Please try solution described in this topic:

Hi @Lera , i have already tried this method but still having the same issues.

Did you check Date format in Action? I see that date in your recording is - 9/6/2019. So you need to find the required Format for this date. Please pay attention that you can type format that you need, if it’s absent in the built-in list.

1 Like

We tested the same. but still same error is showing. I will try sharing the screen if i can, please suggest if there’s any ideas for this issue.

Hi @sambit_pattnPr.
Please share DateFormat action settings. If you found the required format, you shouldn’t see the exception.

Hello @sambit_pattnPr.
Please advise whether this is still actual.