Can I display another fields value in a different field?

magoo
Kilo Expert

For a little background.   On my location table I have a location number that is pulled in from Active directory as well as the location name.   I went ahead and created a new field called location name in which I am pulling both the number + name into the new field (business rule: current.u_location_name = current.u_location_code + ' - ' + current.name;)

 

 

What I am looking to do is to make it so on my incident/ service requests "location" field will display the location name field instead of just the location number.   When i go ahead and change the new field to be the display field= true and change the other to be false it works fine and displays correctly.   Though the issue is when AD does a re-sync overnight its creating hundreds of blank records (due to what only i can assume is LDAP being confused and hence adding a blank record for every location number)

 

I would like to keep 'location' as the field on my incident/ request forms so people have the ability to still search for a location using the magnifying glass/ also have the quick hover display for other location details. (screenshot of the two fields attached)

 

I was thinking maybe a dictionary override would allow me to display the other fields value instead but am unfamiliar with them and my attempts have not worked thus far.


If anyone can give me some guidance it would be appreciated.


Steve

1 ACCEPTED SOLUTION

Ok,



So, we are using a principle "We won't create/update automatically the locations from the AD" (we could and if we would, the message from Christopher Plunkett will help you)



What we want to do is:


1) I have a "location code" (named Company into my AD and u_company in my source table here in ServiceNow)


2) I want to find the right location from the location table (because I suppose the u_location_code is a reference field to the cmn_location table)



OR, on my cmn_location table, the "display" field isn't the u_location_code anymore but "current.u_location_name":


1) I want to use this "current.u_location_name" as the display name for users


2) I want to use the "current.u_location_code" for my technical import of users (from the AD)



The solution is quite simple, we will "configure" the field map rule


1) On your screenshot, please ckick on "u_company" to open the corresponding "field map"


Capture.PNG


2) On the right column, you should have a "referenced value field name", by default this field is empty and the transform map will use the display value (something we can't do anymore), so let's fulfill the field with the information we have at our disposal from the AD, the "location code"


==> Little warning, don't forget to use the "database name of the column"



Feel free to tell if you have troubles to understand the difference between the "display" column for user and this "referenced value field name"


http://wiki.servicenow.com/index.php?title=Creating_New_Transform_Maps#Creating_a_Field_Map: Putting that here btw


View solution in original post

14 REPLIES 14

solutioningnow
Giga Guru

Hi,



To do require configuration,you need to follow below steps:



1) open cmn_location table


2) Right click on header -> Personalize -> Dictionary


3) Set the Display true for required field.



Let me know the outcome



Regards,


Solutioner


Thanks for the reply, this is where I think maybe its something with LDAP as mentioned.   I change the display field and everything works fine when creating incidents, but the moment It syncs (i did a test load of 20 records) it will then create blank locations on my locations table.   (see screenshot)


Locations table.png


david_legrand
Kilo Sage

I think you have here a symptom but not the root cause (especially if it's works without the AD)



So first question, could we talk about your "transform map" and more importantly about the option "run business rules" and the "coalesce fields"?



What do you have for that?



Regards,


On my transform map I have coalesce set to true for user_name (source field: u_samaccountname).  



Run Business rules is also checked as active