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

Question

Question

Assign task to manager of initiator's Forms group

asked on March 20, 2019

Ok, I've been beating my head against the wall on this.  It really SHOULD be simple, but either it's not, or I'm going to feel foolish when someone shows me that it is.

Here's the issue:  I'm trying to figure out how to assign a task to the person who has the Manager role in the initiator's Forms group.  This is for a PTO leave request, so when the initiator submits the original form, I want it to be assigned to their manager, who is given the manager role in their Forms group.

Easy??  or no?

0 0

Answer

SELECTED ANSWER
replied on March 21, 2019

Yes, you can add the Forms database Users/Teams table and lookup against that. 

1 0

Replies

replied on March 21, 2019

On your initial starting form, you could run a lookup based on the username to find the team that that user is in. Fill the lookup result in a hidden field called Team. Then when you assign the following user task, assign it to a team based on a variable. Use the hidden Team field as the variable and then use a team filter to filter down to the "Manager" role. 

This will work as long as each username only returns one team, and each team has someone with the role of manager. 

2 0
replied on March 21, 2019

I had thought of that, but how do I do the lookup to find the Forms team the user is in?  Is the only way with a backend data source such as a CSV file or SQL table, or is there some native way for forms to tell itself "This person is in THIS team"?

I know I can do it with an external lookup, but my client doesn't want to have to maintain yet another data source in order for this to work.

0 0
SELECTED ANSWER
replied on March 21, 2019

Yes, you can add the Forms database Users/Teams table and lookup against that. 

1 0
replied on March 26, 2019

Nice.  I like it.

0 0
replied on March 28, 2019

Hey Jared,

Looks like to use this, I have to jump through about 4 or 5 tables.  You wouldn't have a stored procedure that would do it, would you?

I created a custom role called "Supervisor" and assigned it to one person on each team.  From what I've dug out of SQL, it looks like I have to do the following:

1. Look at the cf_users table for "username" and find the "user_id"

2. Look at the team_members table with "user_id" and find "team_id"

3. Look at team_roles with "team_id" and find "id"

4. Look at team_member_team_role_mapping with "id" and find "team_member_id"

5. Look at team_members with "team_member_id" matching to "id" and find "user_id"

6. Look at cf_users with "user_id" and find "displayname"

 

That would return the displayname of the person on the team with the manager role.  Not sure how to put that together, though.

0 0
replied on March 28, 2019

Ended up doing this using 6 lookup rules to handle the 6 steps.  Not ideal, but it works.

0 0
replied on March 21, 2019

To be a bit clearer, the Team Admin and Team Manager security roles give that user rights to add/remove members from the team, edit the team name, and edit the team description and settings. These are for managing the team resource in Forms, not necessarily the person who is the business manager of the team. You should add a custom role (probably called something other than "manager" so it's more clear), and use a team filter to assign to just that person. 

1 0
replied on March 21, 2019

Yeah, I know that muddies the water a bit.  We should probably create a role called "Supervisor" or something.  For now, though, the organizational supervisor is the only one with the "Manager" role.

0 0
replied on March 22, 2019

To accomplish something similar, I found it best to follow the submission with a workflow that would run the queries to find the target for the next task. In your example, you'd probably only need to identify the submitter's Forms team, and the task could filter to the manager role of that team.

Lookups on the initial form become especially problematic when you allow saving of drafts, because the manager when they started the form may not be the same person when they finally submit it.

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

Sign in to reply to this post.