Help with populating user table reference field values in catalog item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago - last edited 2 hours ago
Hi Team,
I have the below catalog client script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
Issue in your script
-> you cannot dot walk 1 more level in getReference() hence manager.phone won't come
-> location, center code and reporting manager seems to be string type, make them reference type referring to correct table and it will work
OR -> Easy approach
you can use Auto populate feature to populate other variables based on reference variable and no scripting required
Ensure you create correct variable types
Example: if you are dot walking and bringing phone then you should have string variable
if you are dot waling and bringing some reference value then your variable should be reference type referring to correct table
Auto-populate a variable based on a reference type variable (Utah)
💡 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 || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
Hi @Arka Banerjee1 ,
dot-walking does NOT work client-side (ex: user.manager.phone)
This is why:--
- location - sys_id
- center_code (cost center) - sys_id
- reporting_manager - sys_id
- reporting_manager.phone - blank
Because the referenced fields do not auto-expand on the client.
Use GlideAjax to retrieve expanded values!