Forum Discussion

Patty2190's avatar
Patty2190
Copper Contributor
May 05, 2021
Solved

SP- Online Form Formatting header

Hello,

 

I have this question about the form formatting using JSON. When you hit the new button on the Sharepoint List and then go the edit pencil and select configure layout i go to the header. I was wondering is it possible to change the color based on column that is a Yes or No value?

  • Patty2190 Yes it is possible. You can change the color of header text based on Yes/No (Boolean) column.

    Check below code sample for your requirements:

     

    {
      "elmType": "div",
      "txtContent": "[$Title]",
      "style": {
        "color": "=if([$InternalNameOfYesNoColumn], 'green', 'red')",
        "font-weight": "bold"
      }
    }

     

     Notice expression in color attribute.


    Please click Mark as Best Response & Like if my post helped you to solve 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.

2 Replies

  • Patty2190 Yes it is possible. You can change the color of header text based on Yes/No (Boolean) column.

    Check below code sample for your requirements:

     

    {
      "elmType": "div",
      "txtContent": "[$Title]",
      "style": {
        "color": "=if([$InternalNameOfYesNoColumn], 'green', 'red')",
        "font-weight": "bold"
      }
    }

     

     Notice expression in color attribute.


    Please click Mark as Best Response & Like if my post helped you to solve 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