How to pass more than 2 parameters from workflow 'Create Event' activity?

Jeff316
Kilo Guru

 I have a 'create event' activity in my workflow to trigger an email. That works fine. I need to get 4 variables from the catalog request down to the email notification. These 4 variables are reference fields pointing to users who need to be notified.  I know I can pass 2 parameters so how do I pass 4 variables to the email notification triggered by the event?

1 ACCEPTED SOLUTION

Hi Jeff316,

I got it now actually you need to send the notification to the param1 values which is multiple here.

So here you don't need the object part you can simply write the following script in the event1 param field of the create event activity as:

(function() {
var arr= [];

arr.push(current.variables.owned_by);
arr.push(current.variables.managed_by);
arr.push(current.variables.primary_product_owner);
arr.push(current.variables.requested_for.requester_name);

return arr.toString();

}());

We are storing all the users in an array and returning that array to the event param1.

If it helps then please mark my answer Correct and Helpful.

Thanks,

CB

 

View solution in original post

8 REPLIES 8

Chander Bhusha1
Tera Guru

Hi Jeff316,

You can use use 

(function() {

var obj = {};
obj.var1= current.varaiales.var1;
obj.var2= current.varaiales.var2;
obj.var3= current.varaiales.var3;

obj.var4 =current.varaiales.var4;

 


return JSON.stringify(obj);
}());

 

Please mark my answer correct or helpful if it works,

Thanks,

CB

Hi CB,

Thanks for helping. I appreciate it.

I added this to the parm1 on my Create Event activity...

but in the event log its returning null for each var. 

Am I missing something or have the wrong syntax?

I'm not receiving any errors.

 

find_real_file.png

find_real_file.png

 

Hi Jeff316,

I got it now actually you need to send the notification to the param1 values which is multiple here.

So here you don't need the object part you can simply write the following script in the event1 param field of the create event activity as:

(function() {
var arr= [];

arr.push(current.variables.owned_by);
arr.push(current.variables.managed_by);
arr.push(current.variables.primary_product_owner);
arr.push(current.variables.requested_for.requester_name);

return arr.toString();

}());

We are storing all the users in an array and returning that array to the event param1.

If it helps then please mark my answer Correct and Helpful.

Thanks,

CB

 

Thank you CB.

I appreciate the help.

I've learned something new thanks to you.

Have a nice week.