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

Question

Question

How to assign task to one user and have it show up in Forms Inbox

asked on May 4, 2022

We currently have a workflow that is assigning tasks to a manager, based on a dropdown menu where the user filling out the form selects which manager to approve the form, but it is only sending an email notification to the selected manager. How do I get the task to show up in the Forms Inbox under assigned tasks for the chosen manager? The only way I have gotten it to work is by replacing the Workflow Service Task (that sends the email) with a User Task, and assigning to a Team. The issue with assigning to a Team is the task is being sent to ALL Team members rather than the chosen user from the dropdown. Is there a way to assign the task to a specific person within a Team? Or the better option, just assign the task to a User and still have both the email notification and task show up in the Forms Inbox? 

Capture.JPG
Capture.JPG (44.64 KB)
0 0

Answer

SELECTED ANSWER
replied on May 4, 2022 Show version history

When assigning to a Team within Forms, you can use the "Filter" option to build filters to determine who you want to assign the form to within the team, and these filters are very powerful.

Here's an example of a filter that assigns the form to the user within the team with a specific username, which came from a field (in this example, the field has variable name of selected_employee_username): 

$result = team.findTeamMembersByUserName($util.getValue('selected_employee_username')); 

 

Here's an example of a filter that assigns the form to the users within the team with a specific role in the team (in this example, the role is named IT Department): 

$result=team.findMembersByRole('IT Department');

 

You can also do more complex filters.  Here's an example of one from an expense form, where a member of the Accounting department, who has the role allowing approval of these requests, but making sure the request isn't for themselves or a member of their staff - the idea here being that the Accounting department member being assigned the form should not be assigned a form for themselves, or that they would be processing as a manager.  This starts by finding the users who are in the three fields, then finding the users who have the role to review these items, and then finding only the staff who have the role but are not in the three fields.

var recipient = team.findTeamMembersByUserName($util.getValue('selected_employee_username'));
var approver = team.findTeamMembersByUserName($util.getValue('selected_employee_supervisor_username'));
var approver2 = team.findTeamMembersByUserName($util.getValue('selected_employee_supervisor2_userid'));
var excluders = $util.union(recipient, approver, approver2);
var userWithRole = team.findMembersByRole('Expense Reimbursements');
$result = $util.difference(userWithRole, excluders);

 

The Laserfiche help files include some instructions regarding how to set-up filters and the Methods that are available for use in the Javascript: https://doc.laserfiche.com/laserfiche.documentation/11/administration/en-us/Default.htm#../Subsystems/Forms/Content/Inbox-And-Teams/JavaScript-Filter-Expressions.htm

3 0
replied on May 6, 2022

Thank you! This worked! Oddly enough, this is the method I tried a week ago, except I chose the wrong variable, so it didn't work then and I gave up too soon. 

1 0
replied on May 6, 2022

Really glad to hear you got it working!

Please consider marking the question as answered.

Have a great day!

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.