0

Using JSON formatting, is it possible to hide a column based on another column value.

Example:
View displays columns A, B, C and D
View is limited to one row
If the value in column D equals Yes, don't display column A.

Edit - SP Online modern site is being used.

0

If your are not using a modern site, i will advise you to use JSLink

CSharpCorner

  • I'll give it a shot and report back. Thx! – Taco_Buffet 2 days ago
0

You could use the below JSON code to format the column A:

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "debugMode": true,
  "elmType": "div",
  "txtContent": "@currentField",
  "style": {
    "display": "=if([$ColumnD]=='Yes','none','')"
  }
}

Test Result:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.