How do I send a notification to all the users collected in a list collector variable?

mslocum
Mega Expert

I am using a list collector that references the sys_user table to capture which users need access to a product using a catalog item. Once the work is complete the workflow is set to send a notification to these users but I am unable to get it to work.

answer = [];

answer.push(current.variables.users_needing_access.sys_id);
1 ACCEPTED SOLUTION

mslocum
Mega Expert

The answer was actually very simple. List collectors already save users in a comma separated list as required by notifications. I was very much over complicating it.

 

Heres what I ended up with that worked, I should have tried this first:

answer = [];

answer.push(current.variables.users_needing_access);

View solution in original post

7 REPLIES 7

Manish Vinayak1
Tera Guru

Hello,

I am assuming you are using the notification activity in the workflow.

Did you try using just the following?

answer = String(current.variables.users_needing_access);

Give it a try and see how it goes.

Hope this helps!

Cheers,

Manish

SanjivMeher
Kilo Patron
Kilo Patron

Try below script

 

answer = [];
var user_list =current.variables.users_needing_access.sys_id.toString();

answer=user_list.split(',');

Please mark this response as correct or helpful if it assisted you with your question.

Prateek kumar
Mega Sage
answer = ifScript();

function ifScript(){
var final = [];
var users = current.variables.users_needing_access;
return final.push(users.toString());
}

Please mark my response as correct and helpful if it helped solved your question.
-Thanks

dvp
Mega Sage
Mega Sage

variables.list_collector_variable return the sys_id's of users in comma separated values

Try this

answer = [];

answer = current.variables.users_needing_access.toString().split(',');