- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2023 06:06 AM
Hello, everyone.
I have a phone number field in my Transform map that needs one of two things to happen.
- If the source Phone number is a specific value (i.e. '555-55-5555') then we don't update the target phone number.
- If the source phone number is anything else, run the script for that mapped field that will modify that phone number before updating the target phone number.
I've seen this post, Transform map script ignore particular field updat... - ServiceNow Community, which isn't exactly what my situation is. And I looked up the precedence order for how scripts run during a transform. But I can't figure out quite how to make this work for my situation.
Could someone point me in the right direction?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2023 06:26 AM
Hello @Brizky ,
You can remove the field map for phone number and write on before transform script.
You can try the below script:-
if(source.phone_number != "555-555-5555") {
target.phone_number = source.phone_number;
}
Please Mark my answers Helpful & Accepted if I have answered your questions.
Thanks,
Alka
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2023 06:26 AM
Hello @Brizky ,
You can remove the field map for phone number and write on before transform script.
You can try the below script:-
if(source.phone_number != "555-555-5555") {
target.phone_number = source.phone_number;
}
Please Mark my answers Helpful & Accepted if I have answered your questions.
Thanks,
Alka
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2023 06:43 AM
And I can leave all of my other field mappings as is and they'll all still be processed?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2023 06:44 AM
@Brizky Yes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2023 06:46 AM
I think this may be the way to go. Thank you.