Topic Options
#40330 - 08/07/12 09:30 AM Set Job Variable in VB script (XMLget)
Kap Offline
OL Toddler

Registered: 10/20/10
Posts: 45
Hi
Is it possible to set global variables by reading an xml file via a script (VB)?
I've got a Set Job Infos and Variables which sets the variable via get location (e.g. XMLget) however I would like to replicate this function via a VB script if its possible.

I've tried
Watch.SetVariable "global.XMLDocTypeTxt", xmlget('/quartile[1]',Value,KeepCase,NoTrim)

but can't get it working. I've tied setting a local variable first using xmlget as well but again without any success. Is this possible?
Thanks

Top
#40331 - 08/07/12 09:42 AM Re: Set Job Variable in VB script (XMLget) [Re: Kap]
Raphael Lalonde Lefebvre Offline
OL Expert

Registered: 10/14/05
Posts: 3631
Loc: Objectif Lune Montreal
Kap,

You cannot directly call xmlget in a Run Script action. You can, however, use it with the Watch.ExpandString command. Example:

Code:
Watch.SetVariable "global.XMLDocTypeTxt", Watch.ExpandString("xmlget('/quartile[1]',Value,KeepCase,NoTrim)
")



This should properly set the variable to the value you are looking for, assuming your xml path is correct.

Hope that helps!

Regards,
Raphaël Lalonde Lefebvre

Top
#40348 - 08/09/12 08:51 AM Re: Set Job Variable in VB script (XMLget) [Re: Raphael Lalonde Lefebvre]
Kap Offline
OL Toddler

Registered: 10/20/10
Posts: 45
Perfect Thanks!

Top