Populate reference values based on user search

Shwetha Nair
Giga Guru

Hi Developers!

 

We are having a requirement to add meta tags to the reference values so that whenever user searches with keyword the related values populate in reference field.

Meaning, We have a reference field Application referencing to cmdb_ci table which has certain filter put on it. Now when user tries searching with excel , it does not show up any values but if user puts Microsoft excel the he/she is able to select the value. So the requirement is , even if user searches with MS / excel then also this Microsoft Excel should show up in the reference field for selection.

 

Is there a possibility to do so?

 

Thanks in advance,

Fellow developer 🙂

1 ACCEPTED SOLUTION

Shwetha Nair
Giga Guru

After some trial and error, I was able to display values only from the name field yet filtering the results using both from name and meta tag coloumn from the referenced field 

Ref qualifier : ref_auto_completer=AJAXReferenceCompleter,ref_ac_columns=u_meta_tag,ref_ac_columns_search=true,ref_ac_display_value=false

 

 

View solution in original post

6 REPLIES 6

Sandeep Rajput
Tera Patron
Tera Patron

@Shwetha Nair You need to add meta tags column on the tables where you wish to apply the search using meta tags. You can then add the meta tag column in ref_ac_columns on the reference qualifier of your reference field. You can also set ref_ac_column_search to true so that search can be made in meta tags as well. Finally use ref_ac_column_display to just specify the columns which needs to be shown in the reference field during search.

 

Hope this helps.

hi @Sandeep Rajput 

 In that case, it will show meta tags as well in the display . Is there a way to hide that from the form?

 

Thanks,

Shwetha Nair

@Shwetha Nair 

use ref_ac_column_display to just specify the columns which needs to be shown in the reference field during search.

 

@Sandeep Rajput 

As suggested, i created the meta tag coloumn and added it to ref. qualifier of the variable for the search in the form. But I do not want this meta tag coloumn (see highlighted in form view) to be visible in the form. Is there any way to hide it but it should be used as a feature to populate values in the field.

please refer to the ss attached.

 

Thank you