Update a Person field in SharePoint from one list to another using Power Automate

In today’s blog post, we’ll talk about how we can update a person field in SharePoint from another list, using Power Automate. This might sound a bit “cloudy” right now (pun intended 😉), but will be clearer when we get onto it. And I found this solution/workaround very useful with some of my customers.
What’s the scenario?
Let’s say you have a SharePoint list with information about people. Basic information as in their display name, email address, role, etc… and those users are in that SharePoint list for a reason: They will somehow be involved in your PowerApps application. As a simple example, let’s called them “Approvers”. This is a very common reference that most users are familiar with for visualization.
We have other lists, where we store (let’s say) requests. And we know that people join an organization, leave the organization, or change roles within the org. So when someone is not relevant for what we need (i.e.: moved role), we’ll replace with someone else (another “Approver”).
The idea is that when we update this person in the SharePoint list, it also amends it in the other SharePoint lists where this person is referenced in. I hope things are getting a bit clearer now? 🙂
SharePoint setup
This is how our SharePoint lists are going to be setup. (All the list/column names below are to be changed for your own scenario of course)
Main List
This is the list with every “approver” details. Let’s keep it simple for the purpose of our blog post, but efficient!
Columns:
- Department –> Single line of text
- Manager –> Person
- Manager DisplayName –> Single line of text
- Manager Email Address –> Single line of text
- Director –> Person
- Director DisplayName –> Single line of text
- Director Email Address –> Single line of text
Other List(s)
Those would be where you gather all the “requests” sent from your PowerApps app. We’re only going to create one for that example, but the principle will be the same.
Columns:
- Title –> Single line of text (built-in)
- Dept –> Lookup (to the
Department
field in theMain List
) - Manager DisplayName –> Lookup (Brought along with the
Department
field in theMain List
) - Manager Email Address –> Lookup (Brought along with the
Department
field in theMain List
) - Director DisplayName –> Lookup (Brought along with the
Department
field in theMain List
) - Director Email Address –> Lookup (Brought along with the
Department
field in theMain List
)
The Flow
One important thing to note is that the flow will have to be created in the Default
environment. The reason being that we’re going to use the For a selected item
trigger to run the flow straight from the SharePoint list. At the time of writing this post (October 2022), the trigger is only allowed in this environment.
The flow is not very long, and only requires mapping columns. Below is what it’d look like.
We basically map our columns (in the Main List
) with the appropriate dynamic content in Flow.
Creating test items in our Other List(s)
I have created a couple of test items in our other list where I’ve only entered the values for the Title
and the Dept
column (lookup). Nothing else!
Run the flow (first test)
To show the flow in SharePoint, first you need to select the item to update. Then in the ribbon, click on Automate, and choose your newly created flow.
When the blade on the right handside opens, click on Run flow.
Run the flow (after updating a person field)
Remember, the point is to update the Main List
but also the Other List(s)
. Therefore, this is what we start with in the Other List(s)
:
We know that the flow runs fine, so let’s update a person field in the Main List
. Here I’ve changed the value for the Manager
column (person field) but not the other ones. And as the `Other List(s) values are lookups on the single line of text columns, they will not change either. The flow will amend all for us 🙂
The Results…
So let’s run it! And…… 🥁 success!
The flow updated our Main List
& Other List(s)
with the correct values!
Thanks for reading 🙂