Skip to content

New modern UI document library: headerFormatter broken for person columns #10228

Open
@XueSheng-GIT

Description

@XueSheng-GIT

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

not applicable

Developer environment

None

What browser(s) / client(s) have you tested

  • 💥 Internet Explorer
  • 💥 Microsoft Edge
  • 💥 Google Chrome
  • 💥 FireFox
  • 💥 Safari
  • mobile (iOS/iPadOS)
  • mobile (Android)
  • not applicable
  • other (enter in the "Additional environment details" area below)

Additional environment details

  • Chrome 135

Describe the bug / error

Group headers are broken for new modern ui in document libraries if a json view with headerFormatter (groupProps) is used for person columns (easiest way to reproduce is to set the grouping for a person field to expanded in the view settings).

Screenshot of broken group header:

Image

Steps to reproduce

  1. Create a document library
  2. Add a files to it
  3. Add custom json view (see view formatting below)
  4. Goto view setting and enable grouping for creator (or any other person field) with expanded group (see screenshot below)
  5. Reload page and see broken group header [object Object] instead of person name

View formatting:

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json",
  "groupProps": {
    "headerFormatter": {
      "elmType": "div",
      "txtContent": "@group.fieldData.displayValue"
    }
  },
  "rowFormatter": {
    "elmType": "div",
    "style": {
      "height": "100%"
    },
    "txtContent": "[$FileLeafRef]"
  }
}

View Settings (Grouping):
Image

Expected behavior

Name of person (value of @group.fieldData.displayValue) should be shown as Group header instead of [object Object].

Metadata

Metadata

Assignees

Labels

area:list-formattingCategory: View, row & column formatting with JSONtype:bug-confirmedConfirmed bug, not working as designed / expected.type:bug-suspectedSuspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions