The CreatorCon Call for Content is officially open! Get started here.

Modify Variable Attribute

ngriffiths
Mega Expert

Hi all,

 

I am hoping someone has an answer or any insight on my issue.   I am trying to modify the search criteria of a Catalog reference variable.   In the "variable attributes" field on the variable form we have entered the following: ref_auto_completer=AJAXTableCompleter,ref_ac_columns=name,ref_ac_order_by=code.   This does exactly what we want, however, we would like the user to be able to search by either the 'Name' or the 'Code' columns.   Right now, they can only search by the 'Code' column.   We have tried adding the following: ref_ac_columns_search=true to the end of the script, but this still doesn't allow for the user to search by the 'Name' column.

 

Does anyone have any ideas???   We would appreciate any help

 

Thanks for your help!

Niccole

find_real_file.png

1 ACCEPTED SOLUTION

I was submitting an incident with SN HI and the article below appeared.     This is an issue in Calgary and earlier releases of SN.   According to the KB this is / was fixed with the Dublin release.



https://hi.service-now.com/ciw_kb_view.do?sysparm_article=KB0523227


View solution in original post

11 REPLIES 11

Michael Fry1
Kilo Patron

You should change ref_ac_columns=name to ref_ac_columns=name;code.



So it should read:


ref_auto_completer=AJAXTableCompleter,ref_ac_columns=name;code,ref_ac_order_by=code


Hi Michael,



Unfortunately that didn't work .   Our issue isn't seeing the code or name column in the table view, but that we want to be able to search the cost center by the code (default table value) or the name.



In other words, search 2 columns (code and / or name) verses just the 1 (code).  



Currently, if I were to type '9' into the variable reference field then the list will show me all the records in the table with the code that starts with the number 9 (along with the name).   However, if I type 'F' into the field then it nothing happens / displays in the list.   Hopefully I am making sense in my explanation...


Ok, so you might have to add: ref_ac_columns_search=true. Without it, it will only search on the display field for that table.




I add the code to the variable. Is that where you added it?


Also if you want starts with, you will have to modify glide.ui.ref_ac.startswith and set to True.


Nope...I tried the following and it didn't like it:



ref_auto_completer=AJAXTableCompleter,ref_ac_columns=name,ref_ac_order_by=code,ref_ac_columns_search=true



Still wont let me search on the name column.   We added the code in the 'Variable Attributes' field located on the variable form.