Create a related list from a LIST type field

Lavanya Nagendr
Giga Guru

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!

2 ACCEPTED SOLUTIONS

@Lavanya Nagendr 

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.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

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!

View solution in original post

17 REPLIES 17

@Lavanya Nagendr 

Thank you for marking my response as helpful.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

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!

@Lavanya Nagendr 

Did you mistakenly marked your own response as correct?

Would you mind marking my response as correct as I was able to provide you the solution?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader