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

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.

2 Answers 2


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


  • I'll give it a shot and report back. Thx! Commented Dec 3, 2019 at 15:30

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

  • close. I'm wanting to hide the column, not just the value. my view is filtered to one row. Commented Dec 6, 2019 at 22:15
  • So you want to hide the column header too. However, we cannot not only hide only one column header using JSON View Formatting. We could use "hideColumnHeader": true to hide column headers, but it would hide all column headers. Please read here for more :docs.microsoft.com/en-us/sharepoint/dev/… Commented Dec 9, 2019 at 8:49

Your Answer

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

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