SOLVED

SP- Online Form Formatting header

Copper Contributor

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?

2 Replies
best response confirmed by Patty2190 (Copper Contributor)
Solution

@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.

@ganeshsanap Thank you for your replay. Its working!. 

1 best response

Accepted Solutions
best response confirmed by Patty2190 (Copper Contributor)
Solution

@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.

View solution in original post