SharePoint Document Issues

How to Fix SharePoint JSON Conditional Row Formatting Applying to Every Item

Amos GikundaAmos Gikunda Nov 4, 2026 870 views

Question details

The user's SharePoint JSON conditional formatting rule is incorrectly applying to every row in a photo library instead of only targeting items lacking a specific related lookup value.

Fix SharePoint JSON Conditional Row Formatting Applying to Every Item
Product
Microsoft SharePoint
Device & OS
not provided
Scenario
Applying custom conditional formatting via JSON to highlight specific rows in a SharePoint photo or document library.
Observed behavior
Every row is highlighted or formatted (e.g., appearing red) regardless of whether the individual items meet the intended JSON condition.
Before you start

Ensure you have 'Design' or 'Full Control' permissions for the SharePoint list or library. Always copy and paste your current JSON code into a text editor as a backup before making any modifications.

Solution 1Recommended

Review and Correct JSON Lookup Syntax

Validate the syntax of your JSON condition, specifically ensuring that lookup column values are referenced properly.

When working with lookup columns in SharePoint JSON formatting, checking for null or empty values requires precise syntax. If the condition is malformed or references the column object rather than its value, SharePoint evaluates the condition as 'true' for all items, resulting in formatting being applied to every row.

1
Access View Formatting

Navigate to your SharePoint list or library, click the view dropdown menu in the top right corner, and select 'Format current view'.

2
Open Advanced Mode

At the bottom of the formatting pane, click on 'Advanced mode' to reveal the raw JSON code.

3
Update Lookup References

Locate your condition logic. For lookup columns, ensure you append '.lookupValue' to the internal column name. For example, change '[$YourLookupColumn] == ""' to '[$YourLookupColumn.lookupValue] == ""'.

4
Preview and Save

Click the 'Preview' button to test the changes. If the conditional formatting now only applies to the correct rows, click 'Save'.

Review and Correct JSON Lookup Syntax
Verify Internal Column Names: Ensure you are using the internal column name in your JSON, which may differ from the display name if the column was renamed after creation.
Free Microsoft Office alternative

Looking for a Simpler Way to Manage and Format Data?

While SharePoint offers advanced JSON formatting for online lists, many users prefer managing data and project trackers in spreadsheets. WPS Office provides a lightweight, highly compatible, and free office suite where you can apply conditional formatting visually without writing a single line of code.

  1. 1. Download WPS Office: Visit the official WPS website to download and install WPS Office for free.
  2. 2. Open Your Spreadsheet: Launch WPS Spreadsheet and open your existing data file.
  3. 3. Apply Visual Formatting: Select your data range, navigate to the Home tab, and click 'Conditional Formatting' to apply rules instantly.
Highly compatible with Microsoft Office formats including .xlsx, .docx, and .pptx.Apply conditional formatting in spreadsheets instantly using an intuitive visual interface instead of complex JSON code.Lightweight application ensures fast loading times and smooth performance.Familiar ribbon interface allows for a seamless transition from other office software.
microsoft office alternative - wps office

Frequently Asked Questions

Why is my SharePoint JSON conditional formatting ignoring my IF condition?

This typically happens due to syntax errors, referencing incorrect internal column names, or using the wrong data structure for complex column types. When a condition evaluates to an error, SharePoint may default to applying the style to all items.

How do I correctly check if a lookup column is empty in SharePoint JSON?

You must reference the lookup's internal value property. Checking if `[$YourLookupColumn.lookupValue] == ''` or verifying if the lookup array length is 0 (for multi-select lookups) will correctly identify empty rows.

Can I revert to the default view if my custom JSON breaks the SharePoint list display?

Yes. Open the view formatting pane, delete all custom JSON code from the Advanced mode window, and click Save. The list will automatically revert to the default standard SharePoint rendering.