These forums were permanently set to read-only mode on July 20, 2022. From that day onwards, no new posting or comment is allowed on the site, but the historical content remains intact and searchable.

A new location for posting questions about PlanetPress Suite is now available:

OL Learn - PlanetPress Classic (opens in new tab)

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

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.


#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: 681
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
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