- 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 08:42 PM
Hi @Lavanya Nagendr ,
you can create a custom relationship for this
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2025 08:43 PM
related list should be on Service Table so do this
Applies to -> cmdb_ci_service
Queries from -> Table referred by Properties Field
Script:
current.addQuery('sys_id', 'IN', parent.u_properties.toString());
Once this is done then you will see Careers, Sports in related list of CI form
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 09:14 PM
Hi @Ankur Bawiskar ,
Since i want this related list on the Properties field form, i did the opposite of your code but the related list is empty still.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2025 09:22 PM
u_service_product on properties table refer to which table
Share dictionary for that
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