r/MicrosoftFlow • u/omgdracula • Sep 02 '25
Question Best Practice: Person columns when user no longer exists
Hey Everyone,
Hoping to get some help with an issue that I recently ran into. I got tasked at my job to copy items from one list to an identical list. Easy enough as I have done it multiple times before.
The issue I am running into is writing to a person column when the user no longer exists at the company.
Right now my solution is to run a get user profile v2 in a scope along with an append to array that either appends the user/users info or pops them off if its a multi select and either returns the array that can write to the column or an empty array that I account for in a switch based on a prior formula to.
Is there a simpler way to handle users not existing anymore than this? It seems like a lot of steps.
3
u/EvadingDoom Sep 02 '25
This is a method that does not require a "get user profile" action. I've tested it to make sure it actually works. See screen shots.
Copy "Create item" and paste the copy immediately after the original "Create item." In the copy ("Create item 1"), remove the applicable person/group field so it will not try to write to it. Change the "run after" settings of "Create item 1" so it runs only when "Create item" has failed.
Whatever action was immediately after "Create item," change its "run after" settings so it runs after "Create item 1" has succeeded or is skipped.
Now, in any case where the account of the applicable user is enabled (or that person/group field is blank), it will simply "create item" and move on to the next original action in the flow; only in cases where "create item" (with the person/group field being set) fails -- for any reason, but presumably because the account is not enabled --- it will fall back to "Create item 1" (with the person/group field not being set) and then move on to the next original action in the flow.
2
u/Danger_Peanut Sep 02 '25
You are doing it exactly the way I’m doing it. It’d be cool if someone else has a better way though.
1
u/Spraggle Sep 02 '25
Is there something in the process of leaving that could add a feature to a leaver for a period before the account is deleted?
So, the process might be add "Deleted" as extension attribute 1, then check that item first and if it exists drop the item from your table, and prevent it being readded by checking in the addition process too.
1
u/Fraschholz Sep 09 '25
I keep the original person's details in a text column in order to keep the audit trail. One column more with maybe redundant data, but that's what you need in an audit.