# What are the prerequisites for using the "Automatic to the manager" assignment method?

**URL:** <https://discuss.workflowgen.com/t/what-are-the-prerequisites-for-using-the-automatic-to-the-manager-assignment-method/368>\
**Category:** Process Design\
**Created:** [January 1, 2005, 7:46pm UTC](https://discuss.workflowgen.com/t/what-are-the-prerequisites-for-using-the-automatic-to-the-manager-assignment-method/368 "2005-01-01T19:46:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![wfg-admin](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.workflowgen.com/wfg-admin/32/714_2.png) [@wfg-admin](https://discuss.workflowgen.com/u/wfg-admin)\
**Post date:** [January 1, 2005, 7:46pm UTC](https://discuss.workflowgen.com/t/what-are-the-prerequisites-for-using-the-automatic-to-the-manager-assignment-method/368/1 "2005-01-01T19:46:32Z")

</div>

For each directory user, the **Manager** field must be filled in with the manager’s username (system login).

---

<div class="post-metadata">

**Author:** ![marinam](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.workflowgen.com/marinam/32/322_2.png) [@marinam](https://discuss.workflowgen.com/u/marinam)\
**Post date:** [August 25, 2020, 10:39am UTC](https://discuss.workflowgen.com/t/what-are-the-prerequisites-for-using-the-automatic-to-the-manager-assignment-method/368/2 "2020-08-25T10:39:23Z")

</div>

Hi @eddy.daouk ,

Is it possible to assign action to Manager of the Requester’s Manager?  
We would like to have certain level of management to review and approve requests initiated by all their subordinates on different hierarchy levels.  
For example, we have the following organizational structure:  
 ![image](https://canada1.discourse-cdn.com/flex030/uploads/workflowgen/original/1X/af0a0c263079bced55668ce83380a5a66a5a5b2e.png)  
We would like to have Manager to approve all requests initiated by Team Leads or Specialists.  
Is something like this possible in WFG?

Thank you,  
Marina

---

<div class="post-metadata">

**Author:** ![eddy.daouk](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.workflowgen.com/eddy.daouk/32/672_2.png) [@eddy.daouk](https://discuss.workflowgen.com/u/eddy.daouk)\
**Post date:** [August 31, 2020, 7:55pm UTC](https://discuss.workflowgen.com/t/what-are-the-prerequisites-for-using-the-automatic-to-the-manager-assignment-method/368/3 "2020-08-31T19:55:52Z")

</div>

Hi @marinam,

There is no default functionality in WorkflowGen that retrieves the manager of a user’s manager.

You can query the WorkflowGen’s database in .NET code behind using the following query:

```auto
SELECT USERNAME FROM Users 
WHERE ID_USER = 
(SELECT ID_USER_MANAGER FROM USERS WHERE ID_USER = 
 (SELECT ID_USER_MANAGER FROM USERS WHERE USERNAME = 'username_of_current_user')
)

```

Then assign the returned username to the desired action.  
Also don’t forget to handle the case a manager is not mapped to a user to avoid getting assignment issues.

Regards,  
Eddy.

---

<div class="post-metadata">

**Author:** ![marinam](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.workflowgen.com/marinam/32/322_2.png) [@marinam](https://discuss.workflowgen.com/u/marinam)\
**Post date:** [September 4, 2020, 12:01pm UTC](https://discuss.workflowgen.com/t/what-are-the-prerequisites-for-using-the-automatic-to-the-manager-assignment-method/368/4 "2020-09-04T12:01:19Z")

</div>

@eddy.daouk Thank you for the feedback.
