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

Question

Question

Determine if Original Submitter Has a Role

asked on May 21, 2021

Hi,

I have a Forms process that, if entered and submitted by an Assistant (we'll call this point "A"), it needs to make a stop on the same team as that Assistant as a task ("B") for with someone with an Approver role.  Once approved, it can continue along the process to the next task for a different team ("C").

The trick is that if someone with the Approver role enters and submits the same starting form without the Assistant's involvement, it should technically just start at "B" and proceed directly to "C".

I find myself needing to know if the submitter of the starting form has a particular role so I can capture it and deal with this through a gateway.  I can't imagine doing this when assigning the task and using something like findMembersByRole because the form for "B" and "C" will be a different one so I can't just use dynamic filters as far as I'm aware.

Any thoughts on how to deal with this situation?  I probably should have drawn this out if it's not clear, but hopefully this is enough to get the discussion going.

We're using Forms 10.4.4.444.

0 0

Answer

SELECTED ANSWER
replied on May 21, 2021 Show version history

Unless you're tracking roles on the starting form with some custom lookup you wouldn't really have a way to "skip" step B through a gateway since role evaluation is really just for task assignment.

However, what you could do is set the Start Event option for "automatically load the next task when the same person is assigned to it" so it is more seamless.

Then in the task use a dynamic filter on the team that checks if the user has the role, if yes, assign it to them and it should load just after they submit, if not, assign it to the team members in that role.

var submitter = team.findTaskLastSubmitters(1);
var usersInRole = team.findMembersByRole('Test');
var user = $util.intersection(submitter, usersInRole);

$result = user.length > 0 ? user : usersInRole;

This filter gets the submitter for the Step 1 (the start should be 1, but double check the step id in the top right of the details pane when you click on the start event).

Next, it retrieves all the users with the desired role from the team and checks for an intersection between the two results (i.e., if the submitter is also in that role).

Lastly, it checks to see if there was an intersection result. If so, it assigns the task directly to that user. If not, it assigns it to the users who are in the role using the full list it retrieved.

 

You can also evaluate variables in the filter if you need your role value to be dynamic.

1 0
replied on May 21, 2021

Thanks Jason, this looks very interesting and I could see it taking me most of the way.  I'm going to play with this a bit and wrap my head around it, but one question popped into my head right away: by using the "automatically load the next task when the same person is assigned to it" setting, would the submitter who has the role then click Submit just to have the same unchanged form appear in front of them right away and have to click Submit again?

I might be interpreting that wrong as well, so I'll take it away and play with it a bit.  I'm also exploring using a workflow that will use the team, role name and submitter to power queries directly in the Forms database and update a BP variable.  I can then use that variable in a gateway to decide the next steps.  I'm not a big fan of this approach, though, in case it breaks in future updates.

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.