- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2022 02:50 AM
Hello Guys,
I have the List collector field, depending on the Opportunity i need to show only the Unique SVO No (display= true is set for this field in the table) please let me know how we can achieve this?
script include::
function QuoteDisplay(oppo) {
gs.log("oppo:"+oppo);
var oppo = new GlideRecord('x_784298_needit_sp_opportunity');
oppo.get(this.getParameter('oppo'));
var svoNo = [];
var gr = new GlideAggregate('x_784298_needit_sp_sub_contract_test'); //GlideAggregate query
gr.addAggregate('count');
gr.groupBy('svo_no'); //Group aggregate by the 'os' field
gr.addQuery('opportunity', oppo.sys_id);
gr.query();
while (gr.next()) {
svoNo.push(gr.svo_no + '');
}
gs.log("svoNo arry::"+svoNo);
return svoNo.toString();
}
in the reference qualifier, calling like this
For the selected Opportunity( in below screenshot ssss), i want to display the Unique quote associated to that in the list collector and it should show only the unique SVO No in the list collector
Can anyone please help me with this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2022 07:19 AM
that's correct.
It's not possible
If my response helped please close the thread by marking appropriate response as correct so that it benefits future readers.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2022 02:54 AM
Hi,
Check the below similar point is answered
https://community.servicenow.com/community?id=community_question&sys_id=79c80b61db5cdbc01dcaf3231f961986
Thanks
Chandu Telu
Please Mark ✅ Correct/helpful, if applicable,

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2022 02:57 AM
Hey,
You can add three lines at the end:
var arrayUtil = new global.ArrayUtil();
var uniqueSVONo = arrayUtil.unique(svoNo);
return uniqueSVONo.toString() ;
Feel free to mark correct, If I answered your query.
Will be helpful for future visitors looking for similar questions 🙂
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2022 03:18 AM
I am getting the unique values from the script include but i cannot set that value to the list collector...
not sure if its possible to achieve or not?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2022 03:03 AM
Hi,
list collector will show records i.e. it holds sysIds which cannot be duplicate.
Now you need to investigate why the Number field in that Sub-Contract-tests table is repeated.
That should not ideally repeat if that Number field is an auto-number
What field is unique in your table?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader