How to allow a Reference Field to search by both Number and ID from the referenced table?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
6 hours ago
Hi everyone,
I have a requirement where a field in my table is referencing another table (Reference field).
In the referenced table, there are two fields:
Number
ID
My requirement is:
If the user types or searches using Number, it should display/select the record using the Number.
If the user types ID, it should also find and display the same record using the ID.
Currently the reference field only searches based on the display value. I need it to allow searching by both Number and ID, and show the corresponding record when either value is entered.
Has anyone implemented something similar?
Should this be handled using reference qualifier, dictionary attribute, or script include / autocomplete configuration?
Note : I tried with (attribute in Attributes field) ref_ac_columns=id,number ut not working as expected and I can able to see only number not Id's.
Any guidance would be appreciated. Thanks!
Spandus
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
Did you try using ref_ac_columns=id,number separately?
If possible, please share a screenshot.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
you need to give the ref_ac_columns attributes for that and give the additional fields
Do give the other attribute as well so that the search happens with id and number
ref_auto_completer=AJAXTableCompleter,ref_ac_columns=id;number,ref_ac_columns_search=true
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
