- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2024 06:49 AM
Hello, I was trying to understand what I might did wrong here.
My goal here is to change only value from "###" to "aaa", the rest of the values should remain untouched.
Unfortunately with this easy function script I am able to change the value "###" to "aaa", but the rest of the fields changed its value to "undefined". Can you please let me know what I am missing here? Thanks in advance.
Here is the simple transform map script function:
answer = (function transformEntry(source) {
if (source.u_business_phone == '###' ){ return 'aaa';}
})(source);
Here is the screen from instance before the transform, then the excel sheet with new data and then after the transform is complete.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2024 07:40 AM
Hi @Miloslav1,
Based on the script you've provided, you're running this as a script at field level. (Business phone field)
I've made a small tweak to your script to use:
answer = (function transformEntry(source) {
if (source.u_business_phone == '###') {
return 'aaa';
} else {
return source.u_business_phone;
}
})(source);
To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Helpful.
Thanks, Robbie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2024 07:09 AM
Hi @Miloslav1 - Try the below code and let me know if it works for you. Please mark it helpful if it worked.
answer = (function transformEntry(source) {
if (source.u_business_phone == '###') {
return 'aaa';
} else {
return source;
}
})(source);
BR,
Shriram Joshi
---------------------------------------------------------------------------------------------
Mark this as Helpful / Accept the Solution if this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2024 07:36 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2024 07:40 AM
Hi @Miloslav1,
Based on the script you've provided, you're running this as a script at field level. (Business phone field)
I've made a small tweak to your script to use:
answer = (function transformEntry(source) {
if (source.u_business_phone == '###') {
return 'aaa';
} else {
return source.u_business_phone;
}
})(source);
To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Helpful.
Thanks, Robbie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2024 07:47 AM
Thank you very much, this solves the problem.