Forum Discussion
Auto-populate a column in one list from a source in a lookup list
I have a list built with the new SharePoint list template called “Approvals Content Scheduler With Approvals” (the target list) and the list is called Timesheet. The purpose is for an employee to log time for a given week and the time is entered into a column as a number. By default, this list has a column named “Author” (Employee) and “Approver” (Person selected to approve).
In a separate lookup list (the source), I have two columns; Employee (which would be the Author in this case) and their manager in the second column named "Manager”.
When an employee creates a new item in the Timesheet list (the target list), the employee becomes the Author, and whomever they selected as the approver becomes the “Approver”. In addition to these two columns, I have created a new column in the Timesheet list (the target list) called “Manager”.
The scenario: When an employee enters a new item in the Timesheet (the target list), I want to use the lookup list (the source list) to grab the Manager’s name and auto-populate this name into the Manager column in the target list.
The lookup list (source) has one column for the employee's name and one column with the name of their manager. How do I get the name of the employee’s manager to auto-populate the Manager column in the Timesheet list (target list)? Basically, I want to use the lookup list to determine who the manager is for the employee and insert the Manager’s name in the Manager column in the target list. I don’t want the user (Employee) to make the selection.
2 Replies
- michalkornetIron Contributor
Hi alandarr, Maybe you can use a Power Automate flow which can be triggered on the creation or edition of the item with the /users/usersID/manager endpoint to get the manager data. Then save the information in the list item.
https://learn.microsoft.com/en-us/graph/api/user-list-manager?view=graph-rest-1.0&tabs=http
- alandarrBrass Contributor
Thanks for the reply. In my case, the managers are part of cross-functional teams and not necessarily the employee's actual manager as listed in Active Directory. I did run across a use case online where the list, or workflow, could pull this information. But, in my case, this won't work. I thought that maybe there was a way to add a formula in one or more of the columns and also avoid making a Power Automate workflow to keep it simple.
After doing some more investigating this morning, I ran across this article that solved my problem. It uses the "Add a column to show each of these additional fields" option for a lookup list. I'm using a new list template and have other questions, but I'll make sure to start a new thread. From what I can tell, there's no way to edit the workflow behind the new list template.