Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

HI all

basha shaik
Tera Contributor

when i am select List collector values , each value generated to sc task

how can i do this workflow

 

bashashaik_0-1716357068989.png

 

  Thanks

2 REPLIES 2

Community Alums
Not applicable

Hi @basha shaik ,

 

You can use flow designer to achieve this

 

 

Please check 

 

 

https://www.servicenow.com/community/servicenow-impact-forum/hi-all/td-p/2939281

 

 

 

 

Tested in PDI & working as expected. Please try

 

I started answering community questions recently. If my answer helped you in any way, please mark it as helpful or correct. It would be a great boost.

 

Jitendra Diwak1
Kilo Sage

Hi @basha shaik,

 

Please try this below code and edit it as per your requirement:

 

//var cert = current.common_name.getValue('sys_id');  // Request Item reference variable of certificate record
//var list = current.variables.u_business_service_list;  // Request Item list collector of related business services

var cert = '9ad10b62dbd56f001bd3c170ba9619e1';  // Testing with certificate's sys_id
var list = [];
var list = 'App 1,App 2,App 3'; // Testing with strings 
var array = list.split(',');

for (var i=0; i < array.length; i++) {
        // M2M table, related list, certificate to business service
	var bs = new GlideRecord('x_teth_ekcm_m2m_business_ser_certificates');  
	bs.setLimit(10);
	bs.addQuery('business_service', '!=', array[i]);
	bs.addQuery('certificate_common_name', '!=', cert);
	bs.query();
	
	if(bs) {
		bs.initialize();
		bs.business_service = array[i];
		bs.certificate_common_name = cert;
		bs.update();
	}
}

 

Please accept my solution if it works for you.

 

Thanks

Jitendra

Please accept my solution if it works for and thumps up.