How to Use Numeric Fields in SharePoint JSON List Formatting
Question details
The user needs to configure SharePoint JSON list formatting to display specific medal emojis based on a numeric column and reformat a text-based name string.

- Product
- Microsoft SharePoint
- Device & OS
- not provided
- Scenario
- Customizing a SharePoint list view to accurately display rankings with emojis and properly format user profile names without overlapping conditions.
- Observed behavior
- Rules need explicit numeric comparisons in JSON if/else statements so that lower-ranked items do not accidentally trigger higher-ranked formatting rules.
Verify that your target 'Sort' column is strictly configured as a 'Number' data type in SharePoint list settings before applying numerical JSON formatting.
Apply JSON Formatting with Explicit Numeric Comparisons
Use nested if-else statements in your SharePoint column formatting to explicitly compare exact numeric values to assign specific emojis.
When dealing with numeric values in JSON formatting, using exact equality operators ensures that conditions like 'third place' do not mistakenly evaluate as true for 'first place' rules.
Open your SharePoint list, click the column header for your numeric 'Sort' field, select 'Column settings', and then click 'Format this column'.
At the bottom of the formatting pane on the right side, click on 'Advanced mode' to input your custom JSON code.
Input your JSON expression using explicit equality checks. For example, use the logic `=if([$Sort] == 1, '🥇', if([$Sort] == 2, '🥈', if([$Sort] == 3, '🥉', '')))` to map numbers to medals.
Click 'Save' at the bottom of the pane. Verify that the correct emojis now appear in the list rows according to their numeric rank.

Format Text Strings in JSON
Use JSON string operations to dynamically rearrange text, such as converting a 'LastName, FirstName' format into 'FirstName LastName'.
Manage Exported SharePoint Data Effortlessly with WPS Office
While SharePoint handles your online lists and JSON formatting, analyzing and formatting that data often requires exporting it to a spreadsheet. WPS Office provides a free, lightweight, and highly compatible alternative to Microsoft Office, making it incredibly easy to open, edit, and analyze exported SharePoint lists.
- 1. Export from SharePoint: In your SharePoint list, click 'Export' from the top command bar and select 'Export to Excel' or 'Export to CSV'.
- 2. Open in WPS Spreadsheet: Launch WPS Office, open the Spreadsheet module, and select the exported file to view your list data.
- 3. Analyze and Edit: Use WPS Spreadsheet's built-in formulas, conditional formatting, and sorting features to further analyze your ranked data.

Frequently Asked Questions
Why is my JSON formatting applying the first-place rule to third-place items?
This usually occurs if your JSON expression relies on greater-than or less-than logic incorrectly, or lacks explicit equality checks. To fix this, always use exact comparisons like `[$Sort] == 1` for specific rankings.
Where can I get advanced help for complex SharePoint JSON formatting?
You can post your JSON code and SharePoint column types in the Microsoft Q&A forums under the SharePoint tag. The Microsoft community and experts there can provide specialized assistance with advanced expressions.
Do I need coding experience to format SharePoint lists?
Basic formatting such as highlighting rows or changing colors can be done using SharePoint's built-in UI without coding. However, advanced customizations like evaluating numeric fields and manipulating text strings require a basic understanding of JSON syntax.




