- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2020 11:20 PM
I need to validate the email. im trying to write on before script in a transform to validate email field and my target table is sys_user.In the source table the field is u_email.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2020 12:07 AM
You can use the email type field or variable which will automatically validate the email address
or
try this script :
var email = source.u_email;
if (!email || email.trim().length <= 0)
return true;
var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
if (!re.test(email))
{
ignore =true;
}
else
{
ignore = false;
}
or you can follow this link :
mark my answer correct and helpful if it helps you !
regards,
apeksha

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2020 12:06 AM
use the script in on before transform map script , select the source(your source table) and target table(sys_user) .
map the fields with mapping assist or auto map matching fields.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2020 12:07 AM
You can use the email type field or variable which will automatically validate the email address
or
try this script :
var email = source.u_email;
if (!email || email.trim().length <= 0)
return true;
var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
if (!re.test(email))
{
ignore =true;
}
else
{
ignore = false;
}
or you can follow this link :
mark my answer correct and helpful if it helps you !
regards,
apeksha

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2020 12:09 AM
in transform map select your source and target table ,map the fields using auto map matching fields or mapping assist.
and then use the above script in transform map script(on before)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2020 11:50 PM
You can use the email type field or variable which will automatically validate the email address
or you can follow this link :
mark my answer correct and helpful if it helps you !
regards,
apeksha