
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2024 11:08 PM
Hi!
Would like to ask some help regarding transform map scripting, this is to copy a new data uploaded from source field and target field which is located in another table.
Tried BR and unable to make it work, did some research and found about transform map scripting and I'm still trying to learn it.
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2024 01:03 AM
try this
(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {
/* 1. Get the value of source field */
var sourceValue1 = target.name;
/* 2. Glide record on Table in which you want to update the record */
var gr = new GlideRecord('service_offering');
gr.initialize();
gr.name = sourceValue1 + new GlideDateTime().getLocalDate();
gr.insert();
})(source, map, log, target);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2024 11:36 PM
transform script is used when you want to handle data manipulation in target field or in some related table being referred by target field
what did you start with and where are you stuck?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2024 12:19 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2024 12:51 AM
please share transform map is on which table?
which target field are you referring here and to which table it refers?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2024 06:25 AM
Hi Ankur,
Transform map is on cmdb_ci_service and target field is on service_offering.
The field from cmdb_ci_service to query is "name" and target field in service_offering is also "name" field, If new item is uploaded in cmdb_ci_service, it should copy the item to service_offering.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2024 01:03 AM
try this
(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {
/* 1. Get the value of source field */
var sourceValue1 = target.name;
/* 2. Glide record on Table in which you want to update the record */
var gr = new GlideRecord('service_offering');
gr.initialize();
gr.name = sourceValue1 + new GlideDateTime().getLocalDate();
gr.insert();
})(source, map, log, target);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader