- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2025 07:50 PM
Hi All,
We have a field 'Properties' which is an list type. This field contains values (i.e, careers, sports....), this relates to our 'Service Domain' field of Service CI (cmdb_ci_service) table.
So how many values selected in the 'Properties' field should result its related service domain CI's in the related list of the form.
Please help me on this.
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2025 12:37 AM
try this first and see if you can avoid scripting, I believe this will work if name field stores choice labels i.e. sports, career
current.addQuery('u_service_product.nameField', 'IN', parent.u_properties.getDisplayValue());
If not then use scripting
I hope I have provided enough guidance and you can take it from here based on your developer skills.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2025 02:41 AM
Thanks @Ankur Bawiskar
It worked when i gave as addEncodedQuery, the below is the final query that worked for me
current.addEncodedQuery('u_service_product.u_nameIN'+ parent.u_properties.getDisplayValue());
Thanks for the help much appreciated!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2025 11:12 PM
'u_properties' is the list field in the 'Properties' table which holds (careers, sports etc.,).
And on the Service Table we have a field 'u_service_product' field which is a reference field. This u_service_product field also have values (like careers, sports).
So we need a related list on the Properties table , if 'sports and careers' is selected on the 'u_properties' field this related list should display Services that has 'u_service_product' is one of 'u_properties'.
Note: u_properties field list refers to 'Choices' table while the 'u_service_product' on the Service table refers to completely different table.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2025 11:44 PM
basically you can query the CI table with current service and show it
// your query to CI able and bring all CIs for this product
current.addQuery('sys_id', 'IN', sysIdArray.toString()); // this array will hold CI sysids
it's very difficult to understand without having a diagrammatic view of the tables involved
I believe I have provided enough guidance.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2025 11:53 PM
you are not sharing the complete details
1) u_properties on Properties table points to sys_choice table
2) Service (cmdb_ci_service) table has u_service_product reference field pointing to which different table? Also that different table has these values sports, careers in which field?
unless this clarity is there I can't help
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2025 12:23 AM
1. u_properties on Properties table points to sys_choice table -- YES
2. Service (cmdb_ci_service) table has u_service_product reference field pointing to which different table? --- 'Product/Platform' table
3. Also that different table has these values sports, careers in which field? --- 'name' field
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2025 12:37 AM
try this first and see if you can avoid scripting, I believe this will work if name field stores choice labels i.e. sports, career
current.addQuery('u_service_product.nameField', 'IN', parent.u_properties.getDisplayValue());
If not then use scripting
I hope I have provided enough guidance and you can take it from here based on your developer skills.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader