Back to view formats
View formattingSharePoint Online

Current User's Rows

Highlights the entire row for any list items assigned to the current user (the user viewing the list view, not the author of the format). You can easily adjust this to use a different column like Author or Editor by changing the [$AssignedTo] portion of the expression.

Current User's Rows formatting preview
Sample preview · View original image

Copy. Apply. Make it yours.

Get this format

1 definition

Review the requirements below, then paste this JSON into the matching formatting panel. Show me where.

Use your list's internal column names and replace any tenant-specific URLs or flow IDs. Formatting is presentation, not a way to secure data.

View formatting
Download JSON
{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json",
  "additionalRowClass": "=if([$AssignedTo.email] == @me, 'ms-bgColor-themeLight ms-bgColor-themeLighterAlt--hover', '')"
}
Schema compatibility review notes

This historical definition differs from the pinned Microsoft schema. This may indicate an unsupported pattern or a schema limitation. Check the original requirements and test in your tenant before use.

  • /additionalRowClass must be object

From the contributor

How to use this sample

Summary

Highlights the entire row for any list items assigned to the current user (the user viewing the list view, not the author of the format). You can easily adjust this to use a different column like Author or Editor by changing the [$AssignedTo] portion of the expression.

By using the Fluent UI color classes for themes, we can ensure our format looks good in all themes including both light and dark as well as custom themes.

screenshot of the sample

View requirements

  • This format expects a person column with an internal name of AssignedTo to be part of the view

Note - This format is intended only for single-select person fields. There is a slightly more complicated sample (multi-person-currentuser-rowclass) that works for both single and multi-select person columns.

Sample

Solution Author(s)
person-currentuser-rowclass.json Chris Kent

Version history

Version Date Comments
1.0 August 21, 2018 Initial release

Disclaimer

THIS CODE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.


Additional notes

Because this format is only using the additionalRowClass property, it can be combined with column formats to make a pretty compelling visualization:

Combined with Column Formatting

Column Format samples shown above:

A similar sample is available for use with multi-select person fields: multi-person-currentuser-rowclass