Reference field in transform map does not accept display name
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2020 08:49 PM
Hello,
I'm currently making a transform map to bulk upload requests - requests are already being inserted however, I need the ff requirements:
- Link the request to an existing Incident (scoped app)
- Get the "requested for" value from the source file (excel)
My issue now is that the transform map doesn't accept the display values from the excel file and instead only accepts it if the source value is the sys_id - which we don't want since other users won't normally get the sys_id of the records themselves.
Is this issue mainly because the reference fields are being maintained in the scoped app and my transform map is in the Global app?
Thank you in advance!
Regards,
Ali

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2020 09:31 PM
you can use "Use source script" in transform map field mapping , here you will do glide record on user table and get the sys_id of the user and then return that as result .
eg:
answer = (function transformEntry(source) {
// Add your code here
var gr = new GlideRecord('sys_user');
gr.addQuery('name',source.<your field name>);
gr.query();
if(gr.next())
return gr.sys_id; // return the value to be put into the target field
})(source);
Doc link for further details.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2020 11:16 PM
Hello,
I tried this on the field mapping and onBefore transform script too but it didn't work.
I also tried linking both OOB and scoped fields but they still returned blank. The field I need to populate is both in RITM and part of a variable set - not sure if there are additional lines required for this case.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2020 11:21 PM
can you add some screenshot of your transform map ?
are you setting the value on catalog form ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2020 11:36 PM
Hello,
Here's my transform map:
Script for Requested for:
answer = (function transformEntry(source) {
// Add your code here
var gr = new GlideRecord("sys_user");
gr.addQuery("name", source.u_requested_for);
gr.query();
if (gr.next()) {
return gr.sys_id;
} else return ""; // return the value to be put into the target field
})(source);
My onBefore transform script has all the fields in the catalog/source file.