Problem with String Conversion to Date/Time Format

The date that I have extracted from a website is set to string (it can’t be set to date format). I need to identify if the date extracted falls on a weekend. I can’t do a calculation unless the format is changed to date/time.

I am getting an error using the Date Conversion:

Error executing DateFormatAction
com.workfusion.studio.rpa.recorder.playback.PlaybackException: Error executing TemplateAction[templateName=DateFormatAction.ftl,id=1,name=Optional[DateFormatAction],parent=-1,arguments=ActionArguments[outputLocale=[en],input=[{${strdate}],targetVariable=[newdate],delay=[0],timeoutMs=[10000],inputLocale=[nl-NL],xsi:type=[recorder:DateFormatAction, recorder:DateFormatAction],pollingInterval=[300],active=[true],inputMask=[MM-dd-yyyy],awaitTimeout=[5000],direction=[STRING_TO_TYPE]]]
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:81)
at com.workfusion.studio.rpa.recorder.player.PlaybackLogic.playNextAction(PlaybackLogic.java:154)
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 ‘{06-12-2022’ 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.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 Script2.run(Script2.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:108)
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:81)
at com.workfusion.studio.rpa.recorder.player.PlaybackLogic.playNextAction(PlaybackLogic.java:154)
at com.workfusion.studio.rpa.recorder.player.PlaybackLogic.run(PlaybackLogic.java:112)
at java.lang.Thread.run(Thread.java:745)

Is there any work around with this issue?

Hello @mdion,

Seems you have an additional bracket sign {, please see on my screenshot below (highlighted by yellow):
image