JSON Column formatting not updated in Quick Edit mode

%3CLINGO-SUB%20id%3D%22lingo-sub-2117218%22%20slang%3D%22en-US%22%3EJSON%20Column%20formatting%20not%20updated%20in%20Quick%20Edit%20mode%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2117218%22%20slang%3D%22en-US%22%3E%3CP%20data-unlink%3D%22true%22%3EI%20have%20applied%20a%20custom%20JSON%20formatting%20to%20several%20SharePoint%20online%20columns%20(new%20experience).%3CBR%20%2F%3EI%E2%80%99m%20using%20JSON%20formatting%20in%20a%20couple%20of%20people%20picker%20columns%20with%20multiple%20selections%20enabled%2C%20so%20that%20the%20formatting%20will%20alert%20the%20user%20in%20Quick%20Edit%20mode%20if%20they%20selected%20more%20than%20one%20name%20(I%20had%20to%20leave%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CEM%3EAllow%20Multiple%20Selections%3C%2FEM%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Eas%20%E2%80%9CYes%E2%80%9D%20for%20these%20fields%20for%20other%20requirements).%3CBR%20%2F%3EIf%20the%20name%20count%20is%20grater%20than%201%2C%20the%20field%2Fcolumn%20gets%20a%20flashy%20red%20formatting%20and%20an%20error%20text.%3CBR%20%2F%3EIt%20all%20works%20great%20for%20all%20fields%2C%20and%20the%20below%20JSON%20column%20formatting%20is%20applied%20to%20the%20columns%20in%20views%20and%20on%20display%20form%20in%20the%20Details%20Pane.%20It%20also%20works%20well%20in%20the%20full%20page%20Display%20Form%20(%3CEM%3EDispForm.aspx%26nbsp%3B%3FID%3DXX%3C%2FEM%3E)%20except%20for%20one%20multi%20people%20picker%20that%20does%20not%20change%20the%20formatting%20when%20the%20user%20changes%20the%20value%3A%3C%2FP%3E%3CP%3EIn%20the%20screen%20recording%20below%20you%20can%20see%20the%20same%20scenario%20applied%20to%20two%20different%20columns%20on%20the%20same%20list%2C%20both%20columns%20have%20the%20exact%20same%20JSON%20formatting%3A%3C%2FP%3E%3COL%3E%3CLI%3EUser%20clicks%20a%20direct%20link%20to%20the%20list%20item%20display%20form%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CEM%3E%3CA%20href%3D%22http%3A%2F%2Fdispform.aspx%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3EDispForm.aspx%3C%2FA%3E%3FID%3DXX%3C%2FEM%3E%3C%2FLI%3E%3CLI%3EQuick%20Edit%20is%20enabled%20for%20this%20list%3C%2FLI%3E%3CLI%3EBoth%20the%20%E2%80%9CHRM%E2%80%9D%20and%20the%20%E2%80%9CGM%20Staff%E2%80%9D%20fields%20have%20the%20exact%20same%20JSON%20formatting%20as%20below%3C%2FLI%3E%3CLI%3EBoth%20fields%20have%20more%20than%20one%20person%20name%20prepopulated%20and%20the%20JSON%20formatting%20is%20applied%20as%20expected%3C%2FLI%3E%3CLI%3EWhen%20the%20user%20edits%20the%20%E2%80%9CHRM%E2%80%9D%20field%20in%20Quick%20Edit%20%2C%20removes%20two%20names%2C%20leaves%20just%20one%20name%20and%20waits%20for%20save%2C%20the%20displayed%20value%20and%20the%20custom%20formatting%20are%20updated%20as%20expected.%3C%2FLI%3E%3CLI%3EBUT%2C%20when%20the%20user%20edits%20the%20%E2%80%9CGM%20Staff%E2%80%9D%20field%20in%20Quick%20Edit%20%2C%20removes%20two%20names%2C%20leaves%20just%20one%20name%20and%20waits%20for%20save%2C%20the%20displayed%20value%20and%20the%20custom%20formatting%20are%20NOT%20updated%20and%20the%20formatting%20still%20suggests%20there%20are%20multiple%20names%2C%20but%20another%20click%20to%20edit%20shows%20there%E2%80%99s%20only%20one%20name.%20even%20when%20the%20user%20clears%20all%20names%20and%20leaves%20the%20field%20empty%2C%20the%20formatting%20is%20not%20updated.%3C%2FLI%3E%3CLI%3ERefreshing%20the%20page%20fixes%20the%20issue%20and%20the%20correct%20formatting%20is%20applied.%3C%2FLI%3E%3C%2FOL%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22recording.gif%22%20style%3D%22width%3A%20610px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F253137i0D04517812AFDE90%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22recording.gif%22%20alt%3D%22recording.gif%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20idea%20why%20one%20field%20would%20reflect%20a%20change%20in%20value%20in%20quick%20edit%20mode%2C%20and%20another%20field%20(of%20the%20exact%20same%20type%2C%20configuration%20and%20formatting)%20would%20not%3F%3C%2FP%3E%3CP%3EHere's%20the%20JSON%20formatting%20I%20use%20for%20both%20fields%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-json%22%3E%3CCODE%3E%7B%0A%20%20%22%24schema%22%3A%20%22https%3A%2F%2Fdeveloper.microsoft.com%2Fjson-schemas%2Fsp%2Fv2%2Fcolumn-formatting.schema.json%22%2C%0A%20%20%22elmType%22%3A%20%22div%22%2C%0A%20%20%22style%22%3A%20%7B%0A%20%20%20%20%22box-sizing%22%3A%20%22border-box%22%2C%0A%20%20%20%20%22padding%22%3A%20%220%202px%22%2C%0A%20%20%20%20%22border%22%3A%20%22%3Dif(length(%40currentField)%26gt%3B1%2C'5px%20dashed%20red'%2C'none')%22%0A%20%20%7D%2C%0A%20%20%22children%22%3A%20%5B%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%22elmType%22%3A%20%22span%22%2C%0A%20%20%20%20%20%20%22style%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%22color%22%3A%20%22red%22%2C%0A%20%20%20%20%20%20%20%20%22font-size%22%3A%20%2220px%22%0A%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%22attributes%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%22iconName%22%3A%20%22%3Dif(length(%40currentField)%26gt%3B1%2C'Error'%2C'')%22%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%2C%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%22elmType%22%3A%20%22span%22%2C%0A%20%20%20%20%20%20%22style%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%22color%22%3A%20%22%3Dif(length(%40currentField)%26gt%3B1%2C'Red'%2C'')%22%0A%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%22txtContent%22%3A%20%22%3Dif(length(%40currentField)%26gt%3B1%2C'Please%20Select%20Just%20One%20Approver!%5Cn%5Cn'%2B%40currentField.title%2C%40currentField.title)%22%0A%20%20%20%20%7D%0A%20%20%5D%0A%7D%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

I have applied a custom JSON formatting to several SharePoint online columns (new experience).
I’m using JSON formatting in a couple of people picker columns with multiple selections enabled, so that the formatting will alert the user in Quick Edit mode if they selected more than one name (I had to leave Allow Multiple Selections as “Yes” for these fields for other requirements).
If the name count is grater than 1, the field/column gets a flashy red formatting and an error text.
It all works great for all fields, and the below JSON column formatting is applied to the columns in views and on display form in the Details Pane. It also works well in the full page Display Form (DispForm.aspx ?ID=XX) except for one multi people picker that does not change the formatting when the user changes the value:

In the screen recording below you can see the same scenario applied to two different columns on the same list, both columns have the exact same JSON formatting:

  1. User clicks a direct link to the list item display form DispForm.aspx?ID=XX
  2. Quick Edit is enabled for this list
  3. Both the “HRM” and the “GM Staff” fields have the exact same JSON formatting as below
  4. Both fields have more than one person name prepopulated and the JSON formatting is applied as expected
  5. When the user edits the “HRM” field in Quick Edit , removes two names, leaves just one name and waits for save, the displayed value and the custom formatting are updated as expected.
  6. BUT, when the user edits the “GM Staff” field in Quick Edit , removes two names, leaves just one name and waits for save, the displayed value and the custom formatting are NOT updated and the formatting still suggests there are multiple names, but another click to edit shows there’s only one name. even when the user clears all names and leaves the field empty, the formatting is not updated.
  7. Refreshing the page fixes the issue and the correct formatting is applied.

recording.gif

 

Any idea why one field would reflect a change in value in quick edit mode, and another field (of the exact same type, configuration and formatting) would not?

Here's the JSON formatting I use for both fields:

 

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "div",
  "style": {
    "box-sizing": "border-box",
    "padding": "0 2px",
    "border": "=if(length(@currentField)>1,'5px dashed red','none')"
  },
  "children": [
    {
      "elmType": "span",
      "style": {
        "color": "red",
        "font-size": "20px"
      },
      "attributes": {
        "iconName": "=if(length(@currentField)>1,'Error','')"
      }
    },
    {
      "elmType": "span",
      "style": {
        "color": "=if(length(@currentField)>1,'Red','')"
      },
      "txtContent": "=if(length(@currentField)>1,'Please Select Just One Approver!\n\n'+@currentField.title,@currentField.title)"
    }
  ]
}

 

0 Replies