How to hide the column values on a reference field of a form?

Claudio2
Kilo Contributor

Hello everyone, a pleasre to meet you all. On the reference field when use the user_name to search a user appears first the values of the column name of the sys_user's table.

find_real_file.png

So, when choose that user, it sets on the name and not the user_name that is what is required to show on the field.

find_real_file.png

Then I try to edit the Variable Attributes of that reference field and put the following value .

ref_auto_completer=AJAXTableCompleter,ref_ac_columns=user_name,ref_ac_columns_search=true,ref_ac_display_value=false

On the ref_ac_columns put the column that only want to show and put the ref_ac_display_value on false to hide the display value, but I think it doesn't work on Service Catalog.

find_real_file.png

Also, edit the attributes of the column user_name and put the same value as above.

find_real_file.png

But, it didn't work.

find_real_file.png

 

Thanks in advance

 

Claudio

1 ACCEPTED SOLUTION

Michael Jones -
Giga Sage

For catalog item variables, this is the designed behavior. You can add additional fields by which you can search, but the value shown in a reference field will always be the display value of the table you are referencing; in this case, the name of the user. 

As a work-around for situations like this you can use a Lookup Select Box; with some config it can behave like a reference field. 

Set the table under type specification to be sys_user. 

Set the lookup value to Sys ID

For lookup label fields(s) enter: user_name

Add a variable attribute of is_searchable_choice=true

The result is something like a reference field where you can look up a record based on the user_name field, but the "backend value" is the sys_id of the user, so you can still easily lookup extended values if needed. 

If you don't need it to act like a reference field and just hold the value for user_name, set User ID as the lookup value. 

find_real_file.png 

 

Hope this helps!

If this was helpful or correct, please be kind and click appropriately!

Michael Jones - Proud member of the CloudPires Team!

I hope this helps!
Michael D. Jones
Proud member of the GlideFast Consulting Team!

View solution in original post

4 REPLIES 4

Michael Jones -
Giga Sage

For catalog item variables, this is the designed behavior. You can add additional fields by which you can search, but the value shown in a reference field will always be the display value of the table you are referencing; in this case, the name of the user. 

As a work-around for situations like this you can use a Lookup Select Box; with some config it can behave like a reference field. 

Set the table under type specification to be sys_user. 

Set the lookup value to Sys ID

For lookup label fields(s) enter: user_name

Add a variable attribute of is_searchable_choice=true

The result is something like a reference field where you can look up a record based on the user_name field, but the "backend value" is the sys_id of the user, so you can still easily lookup extended values if needed. 

If you don't need it to act like a reference field and just hold the value for user_name, set User ID as the lookup value. 

find_real_file.png 

 

Hope this helps!

If this was helpful or correct, please be kind and click appropriately!

Michael Jones - Proud member of the CloudPires Team!

I hope this helps!
Michael D. Jones
Proud member of the GlideFast Consulting Team!

Thank you very much!

It's Working well.

Thanks

Hitoshi Ozawa
Giga Sage
Giga Sage

To show value of User ID (aka user_name) instead of name, set "Display" of user_name to true in the Dictionary Entries on sys_user table.

  1. In Application Navigator, enter "sys_user.list" to display user table.
  2. Right click on the header and choose "Configure" > "Dictionary"
    find_real_file.png
  3. Search "Column name" equal to "user_name"
    find_real_file.png
  4. Set Display to "true"