Forum Discussion
Stylead
Dec 06, 2023Copper Contributor
Displays the Department name
Hello and good morning 🙂
I have a column in SharePoint Person or Group named ( Asset Owner ) which links to our internal directory.
How can I set it so that when I select a name in the ( Asset Owner ) column it displays the Department name in the Department column?
and if removed the Asset Owner I need the Department name to be empty.
Stylead If you just want to "show" the department name in one of the column (if actual value in column is not required for filtering/sorting/in other places like Power Apps, Power Automate), you can do it using JSON column formatting like:
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "div", "txtContent": "[$AssetOwner.department]" }
Where AssetOwner is the internal name of your SharePoint list person column. You can get the internal name of your SharePoint list columns by following this article: How to find the Internal name of columns in SharePoint Online?
If you want to store the actual department value in column, you will have to customize the list form using Power Apps, check:
- Customize a Microsoft Lists or SharePoint form by using Power Apps
- Displaying Department related to user
- Populate department of selected person?
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.
- StyleadCopper Contributor