Syntax Error
Posted: Wed Apr 11, 2018 9:20 pm
I'm trying to teach myself Javascript in order to better use the Scripting module. I have a question about a syntax error in my first script.
I'd like to set the value of a property in a flow element with a simple script. I came up with the following:
var fileStat = new FileStatistics(job.getPath());
var checkPath = fileStat.getString("[Metadata.Text:Path="/field-list/field[2]/value",Dataset="NYCM-Sort-Submit-All",Model="XML"]");
if checkPath === "FIRST CLASS" {
return "C:/JSON_files/NYCM-260.json";
}
return "C:/JSON_files/NYCM-261.json"
The value is from an XML submit point dataset. I'm sure I'm way off base, but would appreciate it for someone to explain what I did wrong.
Thank you.
I'd like to set the value of a property in a flow element with a simple script. I came up with the following:
var fileStat = new FileStatistics(job.getPath());
var checkPath = fileStat.getString("[Metadata.Text:Path="/field-list/field[2]/value",Dataset="NYCM-Sort-Submit-All",Model="XML"]");
if checkPath === "FIRST CLASS" {
return "C:/JSON_files/NYCM-260.json";
}
return "C:/JSON_files/NYCM-261.json"
The value is from an XML submit point dataset. I'm sure I'm way off base, but would appreciate it for someone to explain what I did wrong.
Thank you.