Setting choice action in transform map

Divya95
Tera Contributor

Hi ,

In our transform map ,we have string field mapping .But if the input field length in > 10 ,we need to set choice action as reject .How do we achieve this .Please suggest.

We have written the below code on Source field script .But if we give >10 ,its still creating the record.

 

answer = (function transformEntry(source) {

var temp_customer = source.customer;
if (temp_customer .length == 12)
{
return temp_customer ;
}
else
{
reject =true;
}
// return the value to be put into the target field

})(source);

 

 

 

6 REPLIES 6

Yes i have tried it

SanjivMeher
Kilo Patron
Kilo Patron

Ok. Lets try this solution.

In the mapping, just map one to one without a script.

Create a Business Rule on the transform map and use below script

 

var temp_customer = source.customer;
if (temp_customer.length>10)
{
ignore =true;
}


Please mark this response as correct or helpful if it assisted you with your question.