Reference fields on transform map not populating

matthew_hughes
Kilo Sage

I've got a transform map where I'm trying to update two reference fields:

find_real_file.png

The 'Divisional Application Owner' comes from the 'Application Name' field, whilst the 'EUDA Name' comes from the 'EUDA ID' field. The mapping for one of the fields is:

find_real_file.png

 

I don't have mapping for the 'Divisional Application Owner'  because I thought that would be updated based on a client script I had written.

 

 

1 ACCEPTED SOLUTION

matthew_hughes
Kilo Sage

I now managed to fix this issue by using a script.

View solution in original post

8 REPLIES 8

You are mentioning a client script for the Divisional Application Owner field. Is that how you are setting the EUDA Name field as well?

If so, it will not work because the transform mapping of the import set is done on the server-side. You would have to use a business rule (server script) to populate the fields on update and/or create.

The client script will only work when the record is manually amended because the user is doing an update in the GUI on the client-side

 

matthew_hughes
Kilo Sage

I now managed to fix this issue by using a script.

Hello Matthew,

 

Would you share the script that helped you solve this issue? I am running into the same situation. Will greatly appreciate it.

The script I used was:

(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {
var divisionalApplicationOwner;
 
var grapplicationName = source.u_application_name;
var grOwnerName = new GlideRecord('cmdb_ci_business_app');
 
if (grOwnerName.get(grapplicationName)) {
divisionalApplicationOwner = grOwnerName.u_business_owner.getDisplayValue();
}
target.u_divisional_application_owner = divisionalApplicationOwner;
 
})(source, map, log, target);