Transform Map issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
Hello All,
I have created a transform map for group table created the name field as coelesce and also transformed it it successfully created records everything is fine leaving one thing.
there is a type field which is a list collector in sys_user_group table when i transformed the excel sheet it created some duplicate values in "sys_user_group_type" as incident,change,request etc we already have incident,change,request wtc out of box values how this duplicate value creation can be avoided also it should map the existing correct group types.
one row example of my excel sheet.
| Name | Type | Line Vendor/manager | Description | Group email |
| Test | incident,change | Debasis | test description | test@group.com |
@Ankur Bawiskar any suggestions?
@
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
try applying filter IS ONE OF and see what it shows
like this
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago - last edited 4 weeks ago
Hello @Ankur Bawiskar ,
Also i encountered one weird issue in servicenow.
like if i use one of and provide the names i end up with 0 records.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
there is space before each of the text and hence it might be giving 0 results in list and in script as well
I believe there is space coming from excel as well
try removing/trim the space and then see
updated script
(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {
// your existing logic
// handle list logic here
var typeSysIdArray = [];
var incomingType = source.u_type.toString();
var arr = incomingType.split(',');
for (var i in arr) {
var gr = new GlideRecord("sys_user_group_type");
gr.addQuery("name", arr[i].trim());
gr.query();
if (gr.next()) {
typeSysIdArray.push(gr.getUniqueValue());
}
}
gs.info("Type array is" + typeSysIdArray.toString());
target.type = typeSysIdArray.toString();
})(source, map, log, target);
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
Hello @Ankur Bawiskar ,
i tried using the above by trimming it to avoid any spaces same result the array is coming as blank values i kept a log and saw.
also if i go to the table and put is one of we are getting 0 records there are no spaces also.
please see the screenshot
