Variable attributes in Service Portal

mp27
Mega Contributor

Hi,

I noticed that variable attributes don't work properly in Service Portal.

Setting "ref_ac_columns" won't display the expected columns in the reference field of a catalog item (the columns remain searchable though).

This can be quite critical as only the "display" field seem to be displayed.

For example, it would not be possible to display the full address of a location, except by creating a field on the table for that only purpose, which is not ideal.

Does anyone have a more convenient workaround?

Thank you,

Max

1 ACCEPTED SOLUTION

matthijsoomen
Giga Guru

Hi,



I do not know if you have solved it already, but for others this could still be useful.


To show extra columns in a reference field on the portal you will have to add 2 additional attributes next to 'ref_ac_columns' .


There additional attributes are: 'ref_auto_completer=AJAXTableCompleter' and 'ref_ac_order_by=[display value]'.



So for instance, if you want to also show the email-address for a user in the portal. Your attributes field should look like this:


ref_auto_completer=AJAXTableCompleter,ref_ac_columns=email,ref_ac_order_by=name



Hope this is helpful.



Matthijs


View solution in original post

8 REPLIES 8

larstange
Mega Sage

Hi



You are right - the Service Portal does not render the reference variables the same way as the old service catalog and there are not much to do to affect this.


You can get additional information to be displayed for each record under the display value while searching, but once you have selected a record, the variable will only show the display value.



The only alternative I can think of, is to create your own widget containing a sn-record-picker. The you will have more control over the sn-record-picker.


You display this widget in a macro variable and push the value selected back into your original reference variable, which you then keep hidden.



See the following:



Reference Fields with the snRecordPicker Directive - ServicePortal.io - Service Portal, CMS, and Cus...



Interact with service portal widget in catalog item


mp27
Mega Contributor

Thank you for the answer. However, that's a lot of customisation for a simple catalog item. I'll explore that solution if I have more time.


matthijsoomen
Giga Guru

Hi,



I do not know if you have solved it already, but for others this could still be useful.


To show extra columns in a reference field on the portal you will have to add 2 additional attributes next to 'ref_ac_columns' .


There additional attributes are: 'ref_auto_completer=AJAXTableCompleter' and 'ref_ac_order_by=[display value]'.



So for instance, if you want to also show the email-address for a user in the portal. Your attributes field should look like this:


ref_auto_completer=AJAXTableCompleter,ref_ac_columns=email,ref_ac_order_by=name



Hope this is helpful.



Matthijs


Yes, absolutely. I forgot to update that post. Thank you.