Display user id in one variable and Display user name in another variable in catalog item

kvenkatesh
Kilo Contributor

HI all

Display user id in one variable and   Display user name in another variable in catalog item

I have a two variables in catalog item both are reference   fields connected to the sys_user table   is this possible if yes then how can we achieve this inputs are appreciated

Thanks and regards

Venkatesh

8 REPLIES 8

Deepak Ingale1
Mega Sage

You can add the other column in list view of the popup icon which is available for reference type of variable.


Why do you require redundant variable ?


Community Alums
Not applicable

The way we achieved this was to make only one field a reference, we made the USER_ID field a reference and the NAME field a read only string. We have a client script that performs a glide ajax lookup on change of the USER_ID field to populate the NAME field.



On some of our forms it also does the check on load as the USER_ID is populated as the current user.


HI Simon


I did some changes in the user table to display only   User ids of all the user but in second field also am getting only user ids but i need names in second variable but this changes wil affected globally so i need some other way to complete this any inputs ??



pradeepksharma


ctomasi


Any inputs pls


The display value of a table is what it is - it will display that field across the entire system when any other record references a record on that table. If you have name set up as your display field, that's what gets displayed in a reference field to sys_user. There's no way to do name sometimes, and user id sometimes, and email sometimes. Sorry about that.



What you may want to consider is using instead is one reference field to sys_user, which does the name, and then get the userID using michael.ritchie's getReferenceAdvanced functionality in a client script and place it in a string field. It's pretty easy to configure and use.



getReferenceAdvanced, g_form.getReference and GlideAjax Alternatives