- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2022 05:44 AM
In Field Map, in the source table, I have two fields and I want to add two fields and the result comes in the target table
ex: First name & Last Name, both added and results may come in the target table
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2022 05:52 AM
Hello,
You can either use a field map on one source field (but then check the script box) or use the transform map script (script field right in the center of the transform map itself) and do something like:
//for field map
var string = source.u_first_name.toString() + " " + source.u_last_name.toString();
return string;
//for transform map
var string = source.u_first_name.toString() + " " + source.u_last_name.toString();
target.field_name = string;
The above are examples, please take it from here!
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2024 08:09 AM
Day - 28 ServiceNow Interview Questions - 28
⭐⭐⭐⭐⭐ - Question
--------------------- Import set -----------------------------------
1) In Field Map, in the source table, I have two fields and I want to add two fields and the result comes in the target table
eg: First name & Last Name, both added and results may come in the target table.
Ans)
You can achieve either use a 𝐟𝐢𝐞𝐥𝐝 𝐦𝐚𝐩 on one source field (but then check the script box) or use the 𝐭𝐫𝐚𝐧𝐬𝐟𝐨𝐫𝐦 𝐦𝐚𝐩 script (script field right in the center of the transform map itself)
//for field map
var string = source.u_first_name.toString() + " " + source.u_last_name.toString();
return string;
(or)
//for transform map
var string = source.u_first_name.toString() + " " + source.u_last_name.toString();
target.field_name = string;
---------------------------------------------------------------------------------------
" Information is wealth" ✨
