Forum Discussion
Lists - column to show the department code for an individual listed in a person column
- Aug 03, 2022
simpkinspete Department property is available as an option in 'Show field' for people picker property. But you cannot use a people picker column in a calculate column calculations. Here is a workaround to try -
- Create a text column called 'Emp name'
- Update your person column to display Department value
- Setup a power automate to run and fill in your 'Emp name' text column with 'Name' property accessible for people picker.
If you execute it properly, you will end up with Name and department properties.
If you want to store the department value in column & use it somewhere (like sort/filter/any custom solution) - best possible options for you are customizing the list forms using power apps (department value will shown immediately after list item created) or updating list item with department value using power automate on item creation/update (may take some time to show the department value until flow runs).
If you just want to show the department in list view (no need to store the actual value in column), you can use the JSON formatting like:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"txtContent": "=[$Name.department]"
}
Where replace "Name" with internal name of your person or group column. Follow this article to get the internal name of your column: How to find the Internal name of columns in SharePoint Online?
Output:
Documentation: SharePoint column formatting
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.