0

I have a requirement for setting up a list view that groups by a date and a title, and sorts descending chronologically. The date in the list is a lookup column. Using ootb view settings I can get the data correctly grouped and sorted like this:

enter image description here

The complication is that I would like for the group to be flattened to one level, and have both the date and the meeting title values. All of the items for each date would have the single meeting title. The obvious answer would be to create a column that has both values, but that throws off the sorting of the groups (even if the date is at the beginning.) I've been trying to use Format view to accomplish this, but I can't make it work. I have tried concatenating the two columns together, creating an additional column in the lookup source list, creating an additional column in the target list and Format column to replace the value of the group by field with the combined column.

This column format displays correctly in the list view itself, but the group name label remains the group by value: { "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "div", "txtContent": "[$Meeting_x0020_Date_x003a_Meeting.displayValue]" } enter image description here

Is it possible to accomplish my requirement using Format view?

Here's something that doesn't work in Format view:

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json",
  "groupProps": {
    "headerFormatter": {
      "elmType": "div",
      "style": {
        "flex-direction": "row"
      },
      "children": [
        {
          "elmType": "div",
          "txtContent": "[$Meeting_x0020_Date_x003a_Meeting.lookupValue]"
        }
      ]
    }
  }
}

In this case, Meeting_x0020_Date_x003a_Meeting is the additional column added to the lookup that is used for grouping.

It seems like it should be simple enough to change the groups display value, but I'm about out of ideas. Am I on the right track?

EDIT: image of desired outcome: enter image description here

3
  • Which one is your default column in lookup settings, Title? Can you add screenshot of lookup column settings? Why are you using 2 levels of grouping? Commented Nov 10, 2022 at 3:31
  • Ganesh Title isn't the name of the column I'm using, I was just trying to make my explanation as simple as I could. The additional column I'm trying to reference is called Meeting, and it's single line of text. The default column is Meeting Date (date and time): ![lookup configuration](i.sstatic.net/pNl7f.png) I don't need to group to 2 levels, I just need the information from both columns to be present in the group header, and for the groups to be in chronologically descending order. Essentially, I want to be able to create a view like this, Commented Nov 10, 2022 at 16:45
  • @GaneshSanap Sorry, my reply got truncated. I've added an image to the original post. I essentially just need content from an additional column (or an entire separate column) in the group headers. Commented Nov 14, 2022 at 22:16

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.