Simple javascript problem

Post Reply
BartDenolf
Member
Posts: 31
Joined: Thu Aug 04, 2016 4:06 pm

Simple javascript problem

Post by BartDenolf »

Hello,

I'm not very used to scripting in Switch, so I probably made a mistake in my script. I want to extract the name of someone using the email address included in private data "EMAIL" and then replacing the "." with a space and reinsert it as an other private data to be used later.

If I use the script-element my job stays in the folder before the script, no error message or what so ever. It just does nothing.

This is my script:

function jobArrived( s : Switch, job : Job )
{
var Email = job.getPrivateData("EMAIL");
var Naam = Email.substring(0,Email.indexOf("@"));
Naam = Naam.replace("."," ");
job.setPrivateData("NAAM",Email);
}

Thank you very much
Bart
jan_suhr
Advanced member
Posts: 592
Joined: Fri Nov 04, 2011 1:12 pm
Location: Nyköping, Sweden

Re: Simple javascript problem

Post by jan_suhr »

You have to add an outgoing connection

job.sendToSingle() for example, it will send your file to the next folder.
Jan Suhr
Color Consult AB
Sweden
=============
Check out my apps
BartDenolf
Member
Posts: 31
Joined: Thu Aug 04, 2016 4:06 pm

Re: Simple javascript problem

Post by BartDenolf »

Thanks Jan,

This did the job!

Greetings
Bart
Post Reply