Thanks for that.
Any guidance on how to script it as I've never scripted before?
XML PICK UP RESULTING FLOW
XML PICK UP RESULTING FLOW
The script expression would look like this:
var fileName = s.getVariableAsString("[Job.NameProper:After_]");
s.getVariableAsString("[Metadata.Text:Path="/Request/Items/Item[@LineNumber='+fileName+']/Quantity",Dataset="Xml",Model="XML"]");
Not tested! I hope I got all the single and the double quotation marks, and the escaping right
Freddy
var fileName = s.getVariableAsString("[Job.NameProper:After_]");
s.getVariableAsString("[Metadata.Text:Path="/Request/Items/Item[@LineNumber='+fileName+']/Quantity",Dataset="Xml",Model="XML"]");
Not tested! I hope I got all the single and the double quotation marks, and the escaping right

Freddy
XML PICK UP RESULTING FLOW
Having had a nice Xmas break I'm now looking at this again.
As I said before I'm new to the scripting and what I'm trying to do is only add files to a folder with a certain quantity ie =200.
How do I add this to the scripting expression?
Thanks for any help
As I said before I'm new to the scripting and what I'm trying to do is only add files to a folder with a certain quantity ie =200.
How do I add this to the scripting expression?
Thanks for any help
XML PICK UP RESULTING FLOW
So what you want is not the quantity, but whether the quantity is equal to 200 or not. In other words, you are using this as a condition on an outgoing connection. Conditions must be either true or false, so you have to make sure the script expression results in "true" or "false":
var fileName = s.getVariableAsString("[Job.NameProper:After_]");
var quantity = s.getVariableAsNumber("[Metadata.Integer:Path="/Request/Items/Item[@LineNumber='+fileName+']/Quantity",Dataset="Xml",Model="XML"]");
if (quantity == 200) {
true;
} else {
false;
}
Again, not tested.
Freddy
var fileName = s.getVariableAsString("[Job.NameProper:After_]");
var quantity = s.getVariableAsNumber("[Metadata.Integer:Path="/Request/Items/Item[@LineNumber='+fileName+']/Quantity",Dataset="Xml",Model="XML"]");
if (quantity == 200) {
true;
} else {
false;
}
Again, not tested.
Freddy