cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Power_Automater
Helper III
Helper III

How to update a department field from a people field in a list?

I have a SharePoint list with a people field and a department field. I would like the department field to get automatically checked to make sure that person is still in that department. Based on my research this cannot be done with calculated fields but only dynamically via Power Automate.

I am guessing it would be a scheduled flow (eg. that runs daily) but beyond that I'm not quite sure how to get the departments of everyone in the person field and then update the department field. I do believe we use active directory if that helps.

What would be the best way to approach this?

1 ACCEPTED SOLUTION

Accepted Solutions
Rhiassuring
Community Champion
Community Champion

Hi there, 


Sure - we can do that. First, can you confirm that your Department entries into your field are displayed exactly the same as your Departments in AAD? We will be checking against AAD to identify the accuracy, presumably! 

I've created a list for myself to demo on:

Rhiassuring_0-1649915484244.png

My department in AAD is "Consulting", so our goal is to get an update on the first entry, and a skip on the second. I am also making the assumption that you will only have one entry per person - if there are several entries per person, then, there might be a more efficient way to do this 🙂 


Step 1 - Create a scheduled recurring flow for once a day (or weekly or whatever suits you.) 
Step 2 - Add a "Get Items" action and point it at your list.
Step 3 - Add a condition: On the left hand "Choose a value" side, add "PersonField Department" (in my case, it's called AssignedTo Department". On the right side, click and select your "Department" field.  ⚠️ Your condition will now be within an "Apply to each" and that's exactly what we want!

Step 4 - On the "Yes" side, we do nothing - the departments are right! I'm adding a Compose in mine as a note, because ... well, I like to.  On the "No" side, we are just going to update the current item with the "Assigned To Department" in the "Department" field.

All in all, it looks like this:

Rhiassuring_1-1649916014188.png

 

After running it, my updated list looks like this:

 

Rhiassuring_2-1649916072605.png

 

 

And the one that ran on the item with "Consulting" already as the Department (correctly), shows this in the run:

 

Rhiassuring_3-1649916109300.png

 

Cheers,

 

Rhia

 

 

 

 

View solution in original post

1 REPLY 1
Rhiassuring
Community Champion
Community Champion

Hi there, 


Sure - we can do that. First, can you confirm that your Department entries into your field are displayed exactly the same as your Departments in AAD? We will be checking against AAD to identify the accuracy, presumably! 

I've created a list for myself to demo on:

Rhiassuring_0-1649915484244.png

My department in AAD is "Consulting", so our goal is to get an update on the first entry, and a skip on the second. I am also making the assumption that you will only have one entry per person - if there are several entries per person, then, there might be a more efficient way to do this 🙂 


Step 1 - Create a scheduled recurring flow for once a day (or weekly or whatever suits you.) 
Step 2 - Add a "Get Items" action and point it at your list.
Step 3 - Add a condition: On the left hand "Choose a value" side, add "PersonField Department" (in my case, it's called AssignedTo Department". On the right side, click and select your "Department" field.  ⚠️ Your condition will now be within an "Apply to each" and that's exactly what we want!

Step 4 - On the "Yes" side, we do nothing - the departments are right! I'm adding a Compose in mine as a note, because ... well, I like to.  On the "No" side, we are just going to update the current item with the "Assigned To Department" in the "Department" field.

All in all, it looks like this:

Rhiassuring_1-1649916014188.png

 

After running it, my updated list looks like this:

 

Rhiassuring_2-1649916072605.png

 

 

And the one that ran on the item with "Consulting" already as the Department (correctly), shows this in the run:

 

Rhiassuring_3-1649916109300.png

 

Cheers,

 

Rhia

 

 

 

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (3,815)