Question

I have a view that sorts items based on a date field, from earliest to latest.

The order will change over time, as users make edits to the item dates.

I would like to apply formatting that will always highlight the first 5 rows.

Was it helpful?

Solution

If you are using modern layout you could use view formatting:

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",
  "additionalRowClass": "=if(@rowIndex < 5 ,'sp-field-severity--severeWarning','')"
}

Details available here: https://github.com/SharePoint/sp-dev-docs/blob/master/docs/declarative-customization/view-formatting.md

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top