Conditional formatting based on choice field
This example was adopted from a column formatting example, Conditional formatting based on the value in a text of choice field, with some important differences to apply the concept to list view rows. The column formatting example applies both an icon and a class to a column based on the value of
additionalRowClass attribute in view formatting, however, only allows you to specify a class and not an icon. Additionally, since
@currentField always resolves to the value of the Title field when referenced inside a view format, this sample refers to the
$Status field directly to determine which class to apply to the row.
- This format expects a text/choice field with the values of Done, In progress, In review, Blocked, or anything else
|json-file-name||Lincoln DeMaris (Microsoft)|
|1.0||August 10, 2018||Initial release|
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.