Forum Discussion

Chris_Boylan's avatar
Chris_Boylan
Copper Contributor
Dec 30, 2021
Solved

Sharepoint list format whole row using indexOf

Hoping this will be a simple question for someone who knows JSON. I'm new to JSON and have found two examples of conditional formatting I'm trying unpick to colour a whole row on a sharepoint list us...
  • Don Kirkham's avatar
    Jan 02, 2022

    Chris_Boylan 

     

    I haven't tested, but you should be able to replace the entire operator object that starts with opening brace on line 3 and ends on line 16 with the if statement on line 6 in first example.  Then replace @currentfield with [$Training_x0020_Crs_x0020_Ttl]

     

    The result will be the following:

    {
      "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json",
      "additionalRowClass": "=if(indexOf([$Training_x0020_Crs_x0020_Ttl],'oliday') != -1, 'sp-css-backgroundColor-BgCornflowerBlue sp-field-fontSizeSmall sp-css-color-CornflowerBlueFont','')"
    }

    I hope this helps.

    Don

    Please click Mark as Best Response & Like if my post helped you to answer or resolve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

     

Resources