Populate List collector into a related list.

Srikanth Menava
Kilo Sage

Hello SNC, 

 I have created a catalog form and it has a list collector variable which is refering to task table and my reference qualifier will filter the items, Everything is fine untill this point.

Now in the RITM created, I want all the selected items from the list collector(which are shown in the variables section) should be populated as individual items in the related list.

Please let me know how this can be achieved.

TIA

1 ACCEPTED SOLUTION

I was able to achieve it myself with the following line in the query of the custom related list,
current.addQuery('sys_id','IN',parent.variables.list_collector_name);

Might be usefull for anyone.

View solution in original post

9 REPLIES 9

jMarshal
Mega Sage
Mega Sage

Related lists need to reference tables...so you'll need an intermediate table (custom table) for this.

After you get the data with the list collector, insert each item into the custom table individually, then reference that table in the related lists section.

Don't forget a RITM reference column on the custom table to filter the selections to the RITM that selected them.

Does it really need a custom table.

 The values I get are inc and prb records and these were already in task table.

 So why can't I create a relationship on task table.

I thought I might need a script include to get the value from a list collector and pass them as comma separated independent items. and can wwrite a client script to populate the answers.

Will that be the rightt approach???

Gotcha...but unfortunately, yes.

Related lists can only reference a single table...just to confirm, you specifically want to use a related list, yea?

I mean, you could replicate the functionality of the related list feature for your ITSM module in question (Service Catalog/RITM)...but I would advise against that.

In the end, S-Now operates like a relational db, which in strict db terms, would require a join view for this type of functionality...and the only way to do that on the platform without an intermediate table, is in reports.

If you only want to reference the records that you are collecting, but not display in a related list (tab at the bottom of the task), this can be done without an intermediate table or "advanced" customization.

Understood why you advised the above . But please navigate throught the following URL

https://www.servicenow.com/community/itsm-forum/list-collector-records-to-display-in-related-list/m-...

I am more inclined towards brads approach where we dont need a custom table.

Thanks for the response tho.