Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

How to make a Robust Transform Engine Glide Lookup Operation conditional?

Steve Stivers1
Tera Contributor

I am building a robust transform ETL definition and have it almost working.

I have the glide operation working but I need it to only run if the source field is not empty.

I see the "Is Conditional" check box and see that when I check it there is a place to enter a script. What I can't find is any documentation about what I can do in that box. How do I access the field value? What should the script return?

1 REPLY 1

Steve Stivers1
Tera Contributor

I did a work around by using a Script Operation and this script:

 (function(batch, output) {
    for (var i = 0; i < batch.length; i++) {
        if(batch[i].input != ""){
            var grUser = new GlideRecord("sys_user");
            grUser.addQuery("name", batch[i].input);
            grUser.query();
            if(grUser.next()){
                output[i] = grUser.sys_id;
            }
        }
    }
 })(batch, output);