How to Show or Hide SharePoint Fields Based on the Current User
Question details
The user wants to dynamically show or hide specific SharePoint list fields depending on the currently logged-in user.

- Product
- Microsoft SharePoint
- Device & OS
- not provided
- Scenario
- Attempting to use JSON conditional formatting expressions like [$CurrentUser] or @Me to restrict or display list fields automatically.
- Observed behavior
- SharePoint's built-in conditional formatting does not reliably identify the current user automatically to execute the field visibility rules.
Ensure you have Site Owner or Full Control permissions on your SharePoint list to edit column settings and apply custom JSON conditional formatting.
Use a Person or Group Column for Comparison
Since SharePoint struggles with dynamic user tags like @Me in field-level formatting, a reliable workaround is to compare the current user against a dedicated user column.
Native SharePoint JSON conditional formatting often fails to process expressions like [$CurrentUser] directly for hiding fields in forms. By referencing a specific column that contains the permitted users, you can create a 'contains' condition to manage visibility effectively.
Navigate to your SharePoint list and click on 'Add column' to create a new 'Person or Group' column.
Add the specific users or groups who are authorized to view the fields into this new column.
Go to the list settings, select the form or field you want to format, and open the 'Conditional formatting' pane.
Apply a JSON formula that checks if your newly created user column contains the current user's email or display name to toggle the visibility of the field.

Verify Internal Column Names in JSON
Formatting errors frequently occur due to referencing the display name instead of the system's internal column name in your JSON code.
Contact Your Administrator or Support
If standard formatting and workarounds continue to fail, tenant-level restrictions may be blocking custom scripts.
Looking for a simpler way to manage your documents?
While SharePoint lists are powerful, managing complex permissions and custom JSON code can be frustrating. For your daily document, spreadsheet, and presentation needs, WPS Office provides a free, lightweight, and highly compatible alternative to Microsoft Office.

Frequently Asked Questions
Can I use @Me in SharePoint JSON conditional formatting?
Natively, using @Me or [$CurrentUser] directly in list form conditional formatting to dynamically hide fields is often unreliable. Microsoft generally recommends utilizing filtered views or checking logic against a dedicated 'Person or Group' column instead.
How do I securely hide sensitive fields in a SharePoint list?
JSON conditional formatting only hides fields from the user interface; it does not restrict data at the database level. For true security, you must use item-level permissions or store sensitive data in a separate, restricted list.
Why does my SharePoint conditional formatting formula keep failing?
The most common reason for formula failure is referencing the column's display name rather than its internal name. Always check your list settings URL for the exact internal name and ensure your JSON syntax is strictly valid.
Is using a password text field a good workaround for hiding fields?
No. Requiring users to enter a password into a plain text field to reveal other fields is highly insecure. It does not encrypt the data and fails to protect the underlying list information from being accessed via APIs or standard list views.




