Topic Options
#57846 - 01/08/21 06:37 AM Help converting an XML variable to correct format
Inferno Offline
OL Newbie

Registered: 01/08/21
Posts: 1
Hi,

Thanks in advance for any help you might be able to give, We have an XML file that has a document date in it, this is displayed like 20210108 in the file, however the system we are putting this into needs the format to have the correct / in place so it looks like 2021/01/08.

How can I go about getting the workflow to put these / in and save to the variable name, I have looked at mathematics and find and replace and cannot find a working solution.

Thanks.

Top
#57847 - 01/08/21 08:48 AM Re: Help converting an XML variable to correct format [Re: Inferno]
Jean-Cédric Offline
OL Expert

Registered: 10/03/16
Posts: 650
Loc: Québec, Canada
Define a local variable named myDate
Set the variable with your date in the current format
Add a as Run Script plugin as an Action
Code:
dim theDate
theDate = Watch.GetVariable("myDate")
Watch.SetVariable "myDate", left(theDate,4)+"/"+mid(theDate,5,2)+"/"+right(theDate,2)
_________________________
♪♫♪♫
99 frigging bugs in my code
99 frigging bugs
Take one down
Code around
127 frigging bugs in my code
♪♫♪♫

Top