- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2024 04:38 AM
Hi Team,
I have written on before transform script like below,
if(source.u.dns_name.contains('-sd-')){
ignore = false;
}
else {
ignore = true;
}
Requirement is :
some data having DNS Name field contains, -sd- , those data should insert into the target table, while loading
remaining data should get ignored , but its not happening all the data is getting ignoring now,
how to trouble shoot this,
Regards,
Abhilasha G T
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2024 04:45 AM
Hi @Abhilasha G T ,
its simple to check , go for the below code:
if (source.u_dns_name && source.u_dns_name.indexOf('-sd-') != -1) {
ignore = false;
} else {
ignore = true;
}
I hope it helps you... 🙂
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2024 04:45 AM
Hi @Abhilasha G T ,
its simple to check , go for the below code:
if (source.u_dns_name && source.u_dns_name.indexOf('-sd-') != -1) {
ignore = false;
} else {
ignore = true;
}
I hope it helps you... 🙂
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2024 04:45 AM
Hi Abhilasha,
It'll be due to an error in your syntax, you've used a period rather than underscore for the fieldname
source.u.dns_name.contains('-sd-')
source.u_dns_name.contains('-sd-')
However I'd consider future proofing your code by doing the following
var dnsName = source.getValue('u_dns_name');
if(dnsName.toLowerCase().indexOf('-sd-') == -1)
ignore = true;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2024 04:46 AM
just a diffrence of 12 seconds @Kieran Anson lol hehehe
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2024 04:47 AM - edited 04-30-2024 04:48 AM
hey @Abhilasha G T
have you tried the same script on field map script? if not try it or apply some logs and check if its entering into the loop
instead of contains you can try indexOf()/ substring() for ignoring those record with -sd-
Please accept the solution /mark this response as correct or helpful if it assisted you with your question.
Regards,
Animesh