how to call a multi row variable sets variable inside the workflow

Sri56
Tera Contributor

Hi Team,

I have created a muti row variable set called-'workflow'

where i have workflow, approver and cc variables as below:

find_real_file.png

How to call this variables inside the workflow.

In other words, i need to use approver and cc as approvers inside the workflow.

Please help me.

 

Thanks,

Srivalli M

1 ACCEPTED SOLUTION

I hope your workflow is running on RITM table if yes the below code will work

Just now tested in my PDI as well.

Keep some logs and try and let me know what logs you have got:

answer = [];
var mrvs = current.variables.workflow;      //use MRVS internal name
for (var i = 0; i < mrvs.getRowCount(); i++) {
    var row = mrvs.getRow(i);                  // getting the row one by one using getRow
    gs.info("approver"+row.approvers);
    gs.info("cc"+row.cc);
    answer.push(row.approvers.toString());      //sending approval to approvers users
    answer.push(row.cc.toString());      //sending approval to cc users & map your variable names
    }
}

Thanks,

Murthy

Thanks,
Murthy

View solution in original post

15 REPLIES 15

Can you share you script with screenshots
So that I can help you

Thanks,
Murthy

Sri56
Tera Contributor

Hi Murthy,

Sure.

Please find the screenshot below

find_real_file.png

and below screenshot of my variable set name

find_real_file.png

Please help me with the code.

Thanks,

Srivalli

Update as it is:

answer = [];
var mrvs = current.variables.MRVS_internalname;      //use MRVS internal name
for (var i = 0; i < mrvs.getRowCount(); i++) {
    var row = mrvs.getRow(i);                  // getting the row one by one using getRow
    answer.push(row.approvers.toString());      //sending approval to approvers users
    answer.push(row.cc.toString());      //sending approval to cc users & map your variable names
    }
}

Let me know if above doesnt work,

 

Thanks,

Murthy

Thanks,
Murthy

Sri56
Tera Contributor

Hi Murthy,

How about this line?

var mrvs = current.variables.MRVS_internalname;

We want the worklfow variable set to be called rite?

 

Thanks,

Srivalli

Yes correct

Sorry 

Please update like this:

var mrvs = current.variables.workflow;
Thanks,
Murthy