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.

Transform map script

dheeru_1994
Tera Contributor

HII All i have requirement ,my requirement is i am using transform map script to update or set new value like my target field name is u_firstname  for that on after i am doing 
target.setValue('u_firstname','xyz');

but after completing transformation in my target table nothing is comming even though source field name and target field name are correct any  help 
Note:-  i am very weak in transform script please provide me stuff with code like how to use ,map, source , target 

thanks everyone

 

1 ACCEPTED SOLUTION

In field map add target field you want to set. And check the checkbox for script(field : Use Source Script). Add below code.

 

return "xyz";

 

It will set the target field value you want to set.

 

View solution in original post

12 REPLIES 12

This is working on in field map source script 

@dheeru_1994Remove field you want to pass static value from field map and try below code in On After. It will work.
    var gr = new GlideRecord('cmn_location');
    gr.addQuery('uniqueValueoftarget', source.fieldtomapwithuniquevalue);
    gr.query();
    if (gr.next()) {
        gr.name = 'dfghjk';
        gr.update();
    }

dheeru_1994
Tera Contributor

okay i will try