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.
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.
- simpkinspeteAug 03, 2022Brass ContributorAh! I didn't know about the Show field options for the people picker. Is there a way to change the Show field for a specific view?
- ganeshsanapAug 04, 2022MVP
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.
- Bharath ArjaAug 03, 2022Iron ContributorIt is a property that is set at column level. Not possible to have a different option for a specific view.
- simpkinspeteAug 04, 2022Brass Contributor
Bharath Arja ganeshsanap - thanks for the responses! I'll take a look at using Power Automate to update the field as needed.
I also submitted a request to the feedback portal to https://feedbackportal.microsoft.com/feedback/idea/d9bd24c3-0114-ed11-a81b-6045bd864d4fthat would act similar to Lookup columns.