May 04 2021 05:35 PM
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?
May 04 2021 09:59 PM
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.
May 05 2021 07:29 AM
@ganeshsanap Thank you for your replay. Its working!.
May 04 2021 09:59 PM
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.