Setting choice action in transform map
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2018 11:57 AM
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);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2018 12:02 PM
Try this
answer = (function transformEntry(source) {
var temp_customer = source.customer;
if (temp_customer.length<10)
{
return temp_customer ;
}
else
{
reject =true;
}
// return the value to be put into the target field
})(source);
Please mark this response as correct or helpful if it assisted you with your question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2018 12:03 PM
please use below code
answer = (function transformEntry(source) {
var temp_customer = source.customer;
if (temp_customer .length < 10)
{
return temp_customer ;
}
else
{
ignore = true;
}
// return the value to be put into the target field
})(source);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2018 12:16 PM
Hi Sachin ,
Thanks .But above script didnt work .Also please note we need to stop record creation .As per my understanding ,ignore just skips that particular field updation but record still gets created

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2018 12:17 PM
Did you try this
answer = (function transformEntry(source) {
var temp_customer = source.customer;
if (temp_customer.length<10)
{
return temp_customer ;
}
else
{
reject =true;
}
// return the value to be put into the target field
})(source);
Please mark this response as correct or helpful if it assisted you with your question.