Variable reference at "cmdb_ci_computer", configuring to look into another field instead of "name"

AdamUMC
Giga Guru

Hi there,

I have a Service Portal Catalog item which contains a variable that is a reference to "cmdb_ci_computer".
When users fill in this field (variable), they have to fill in a value that is available as name (field "name") within "cmdb_ci_computer".

However, within "cmdb_ci_computer", we have created an additional field. It's called "u_stickernumber". Now I want users in the above mentioned case, to fill in the stickernumber instead of the name, to find/select the right record within "cmdb_ci_computer".

I attempt to achieve this, I gave my variable reference, the following "variable attribute":
"ref_auto_completer=AJAXTableCompleter, ref_ac_columns=u_stickernumber"

Unfortunately, this does not work. Anyone any idea how to do this?

Thanks and kind regards,


Adam

1 ACCEPTED SOLUTION

@AdamUMC 

that's correct, at least they can search with it

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

8 REPLIES 8

Ankur Bawiskar
Tera Patron
Tera Patron

@AdamUMC 

name field on Computer table is display=true so once user selects any record it will show only Computer name

you can show users when they type in the variable the Sticker number field using variable attributes

Nothing beyond this can be done. You should not make Sticker number field as Display=true on Computer table as it will be a global change

If you want them to search on that custom field then use this along with your current variable attributes

ref_ac_columns_search=true

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Thank you @Ankur Bawiskar !

"Nothing beyond this can be done. You should not make Sticker number field as Display=true on Computer table as it will be a global change."

I know indeed about this. That's not a good idea, because "Out-Of-The-Box" default, should stay as it is I understand?

"If you want them to search on that custom field then use this along with your current variable attributes ref_ac_columns_search=true."


If I understand you correct, by adding this to mu current variable attributes, I can search by "stickernumber" within this field, only at this Catalog Item  (form), is that correct?

AdamUMC_0-1739884487448.png


Thanks again for your reply!

@AdamUMC 

that's correct, at least they can search with it

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

@AdamUMC 

Thank you for marking my response as helpful.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader