Workflow VBScribt condition help

Posted by: Karlie

Workflow VBScribt condition help - 07/26/18 06:30 PM

Hi there,

I am trying to rename a file using the below VBScript. It doesn't seem to be working, can you help me find where I am going wrong? cheers

if Watch.GetJobInfo(8) =< 900 then
Watch.SetVariable "FileName", "Name_1"
Watch.SetVariable "FileName", "Name_2"
end if

Basically Jobinfo 8 is a numerical number,
if Jobinfo 8 is less than or equals to 900,
then Set variable "FileName" as "Name 1",
else Set variable "FileName" as "Name_2"

The "FileName" Variable is later used to name a file.

Posted by: Philippe F.

Re: Workflow VBScribt condition help - 07/27/18 07:33 AM

You state it doesn't seem to be working, but you don't mention what actually occurs. Do you get an error message? Does JobInfo(8) get set to the expected value in the script?

Add the line
Watch.Log "Jobinfo(8) set to: " & Watch.GetJobInfo(8),2
as the last line in your script to display the value of JobInfo(8) after the script has run.

Then run your process in step-by-step mode.

You could also add the same logging message at the start of the script, to see the value of JobInfo(8)
it runs.