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

Question

Question

How to get inclusive gateway to assign to "person responsible" based on an empty date on the same table row?

asked on October 12, 2022

Could I get some help with a Process Diagram where I need it to assign to fewer and fewer people every time someone submits, based on a Date Completed field (on the same table row) being left blank.  In other words, when someone submits, I need it to loop back to the inclusive gateway and assign this time only to those people that DO NOT have a Date Task Completed filled in.

In the example shown, I would want three people left assigned and not the one marked Complete.

 

0 0

Replies

replied on October 14, 2022

For the assignment back to the team, a filter like this should work.

This loops through each row of the table and adds the user from that row if the date field is blank.

var users = $util.getValue('table_variable','user_variable');
var complete = $util.getValue('table_variable','date_completed_variable');
var assignment = [];
for (var i = 0; i < users.length; i++) { 
  if(complete[i] == '') {
    var user = team.findTeamMembersByUserName(users[i]);
    assignment = $util.union(assignment, user);
  }
}
$result=assignment;

 

As far as the gateway is concerned, you should set the path that exits the "loop" as the default, and the path that leads back into the task with an option like this: 

/dataset/table_variable/date_completed_variable=""

A gateway like that with a table will evaluate as true if any row in the table matches the criteria, so it'll keep taking the path back to the task until every one of the date fields is complete, at which point that path will no longer evaluate as true, and it'll follow the default path out of the loop.

0 0
replied on October 21, 2022

Thanks, Matthew.  I haven't explored this yet.  I do appreciate your response, though and I know it will work for other forms!

I've been working on a solution that Steve Knowlton has given me, where the original form spins off a smaller (single task) form for each row in the table.  This allows me to not need to figure out how to get the right people assigned at the right times.  Plus, I think the people being assigned to these tasks will like this better.  Most of the people being assigned tasks are people that work out of the office and would be reviewing what was assigned on their phones, so the new (single task) form is designed to be more mobile app friendly.  They don't need to see everyone's tasks in the table, they only need to see their own.

1 0
replied on October 21, 2022

That makes sense.  I have some processes that work similarly, and it works quite well.  I hope that solution works out well.  smiley

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

Sign in to reply to this post.