Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Reference field in transform map does not accept display name

Alison11
Mega Expert

Hello,

 

I'm currently making a transform map to bulk upload requests - requests are already being inserted however, I need the ff requirements:

  1. Link the request to an existing Incident (scoped app)
  2. 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

15 REPLIES 15

it will not work this way. on ritm variable, it can be set on existing record not on new record .

variable editor show all the variable which is a UI Macro actually.

why are you setting on ritm ? whats the use case ?

Hello,

 

Use case is end user would have to bulk create SRs for 1k+ users. Initially, we create the SR from the scoped incident (to link the incident # for reference) - so this is a 1:1 scenario. For this case, the incidents are already bulk created but it was never disclosed that these were targeted to have SRs.

 

So for now, I need to link the existing incidents to the SRs to be created using this transform map.

 

My current issues at this point:

  1. I can already link the scoped incident but only by entering the sys_id in the excel. Entering the incident # doesn't work.
  2. The requested for field doesn't populate - I tried user ID, user name and full name but nothing worked too.

to update the variable value on exisitng record.

 

something like below. 

 

target.variables.<variable name> = source.<field>

if above line does not work try this way, 

 

you will use it on transform script. kindly check "run script" check box as true and paste the below script. 

 

eg:

 

var gr = new GlideRecord("sys_user");
    gr.addQuery("name", source.u_requested_for);
    gr.query();
    if (gr.next()) {
        target.variables.<Requested for Variable name> = gr.sys_id;
    } 

Hello,

 

This line actually helped!

target.variables.<Requested for Variable name> = gr.sys_id;

 

The requested for field is being populated but not with the value from the excel file - it's inserting the currently logged in user/requester.

 

I think I'd have to check if we have rules set on the field itself. Or am I still missing something?

 

Thank you!

Alison