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?
Solved! Go to Solution.
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:
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:
After running it, my updated list looks like this:
And the one that ran on the item with "Consulting" already as the Department (correctly), shows this in the run:
Cheers,
Rhia
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:
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:
After running it, my updated list looks like this:
And the one that ran on the item with "Consulting" already as the Department (correctly), shows this in the run:
Cheers,
Rhia
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Announcing a new way to share your feedback with the Power Automate Team.
User | Count |
---|---|
79 | |
22 | |
17 | |
14 | |
13 |
User | Count |
---|---|
133 | |
33 | |
31 | |
31 | |
24 |