How to Fix SharePoint JSON Conditional Row Formatting Applying to Every Item
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.

- 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.
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.
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.
Navigate to your SharePoint list or library, click the view dropdown menu in the top right corner, and select 'Format current view'.
At the bottom of the formatting pane, click on 'Advanced mode' to reveal the raw JSON code.
Locate your condition logic. For lookup columns, ensure you append '.lookupValue' to the internal column name. For example, change '[$YourLookupColumn] == ""' to '[$YourLookupColumn.lookupValue] == ""'.
Click the 'Preview' button to test the changes. If the conditional formatting now only applies to the correct rows, click 'Save'.

Seek Assistance in Official Microsoft Q&A Forums
If syntax corrections do not resolve the issue, consult specialists in the official Microsoft Q&A forums for advanced JSON troubleshooting.
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. Download WPS Office: Visit the official WPS website to download and install WPS Office for free.
- 2. Open Your Spreadsheet: Launch WPS Spreadsheet and open your existing data file.
- 3. Apply Visual Formatting: Select your data range, navigate to the Home tab, and click 'Conditional Formatting' to apply rules instantly.

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.




