Ignore field value in transform map if empty
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-06-2019 08:15 AM
Hi,
I want to ignore the field update if its coming as empty instead of rejecting the entire row. Is this possible?
For example if state is already existing for a user in user table and if a new value is coming from staging table in which state is blank then that field should not be updated and rest all should get updated.
Is this possible?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-02-2022 01:42 AM - edited ‎11-02-2022 02:02 AM
Just write a script for that particular transform map field stating if str = '' ; return false;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-06-2019 09:01 AM
i see few other options. But you will have to check for all incoming empty values.
if(trim(source.field_1)==''){
}
1. Run Script on Transform Map
2. Field mapping script
3. OnBefore Transform Script
Hope this helps
Thanks,
Harshinya

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-25-2021 07:32 AM
Hi, there is a nice and easy way to only do this for one specific field without changing the configuration.
In your Field Map set "Use source script" to true and add this code:
if(source.yourfieldname === ''){ // new value is empty
return target.yourfieldname; // ignore (use existing target value)
} else {
return source.yourfieldname; // otherwise update
}