A While back I wrote a post about Updating People Fields in SharePoint using Flow. On of the requirement is to get the user ID of the user that you want to set a field to.
Get the user ID of a SharePoint user
Table of Contents
How do we get this field ID?
We will need to have the Id to set a people field. Note from my previous post that you want to set a field PersonID if your field is called Person.
The hidden user list
You might remember the hidden user list post by Thomas Zimmergren.
You can get the items from the hidden user list in two different ways. Either use a REST API call or just use the Get Items action in flow. Whichever has your preference.
I’m now using the Get items action.
To Update the list item I’m using the REST API call. Why? Simply because I want my flows to be more generic. I need to be able to copy Flows between environments. This also means that I need to be able to soft copy rather than hard copy the SharePoint site url.
The Get Items will give me an array of 1 users. I queried by email address and I know for sure that I will only get one item back. To make sure that I don’t get one of those annoying apply to each steps added I’m including a first function which will give me the first item in the array of users. The full expression for this is: