You are viewing limited content. For full access, please sign in.

Question

Question

Assign Team task to Role from Check box selections using filters

asked on February 27, 2017

I am trying to route a User task to roles within a Team, based on the selections made on a check box field. Still struggling to work this out.

 

Here is a simple example:

Checkbox Variable = State

Checkbox fields = NSW, VIC, WA

I have it set to route to a specific team called 'Test'. This Team contains 3 Roles (with users added). Each Role is named: NSW, VIC, WA (matching the Check box values). So, I am applying the filter by role option.

We would like the task routed to all users if all tick boxes are completed. If 2 tick boxes are selected, then route to those Users in those 2 States, etc.

 

I have tried the following: 

- $result=team.findMembersByRole($util.getValue('State'));

- $result = team.findMembersByRole('State1')

Still not having any luck, does anyone have any ideas how to do this within Forms?

Filter.JPG
Team details.png
Filter.JPG (64.54 KB)
Team details.png (29.45 KB)
0 0

Answer

SELECTED ANSWER
replied on February 28, 2017

Hi Grant,

Try filter like this:

var obj = $util.getValue('State');
var keys = [];
for(var k in obj) {
  if (obj[k])  keys.push(k);
}
$result=team.findMembersByRole(keys);

 

1 0
replied on February 28, 2017

Thank you Rui, thats got it!

 

0 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.