Forum Discussion
List Lookup Conditional Formatting
- Mar 27, 2023
Kev2023 You can use JSON column formatting for your lookup column like:
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "div", "txtContent": "@currentField.lookupValue", "style": { "padding-left": "10px" }, "attributes": { "class": "=if(@currentField.lookupValue == '','ms-bgColor-red', '')" } }Output:
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.
For SharePoint/Power Platform blogs, visit: Ganesh Sanap Blogs
Kev2023 You can use JSON column formatting for your lookup column like:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"txtContent": "@currentField.lookupValue",
"style": {
"padding-left": "10px"
},
"attributes": {
"class": "=if(@currentField.lookupValue == '','ms-bgColor-red', '')"
}
}
Output:
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.
For SharePoint/Power Platform blogs, visit: Ganesh Sanap Blogs
- Kev2023Mar 27, 2023Copper Contributor@ganeshsanp - thank you for this, that works perfectly. Such simple JSON when you know how.
Very much appreciated.- ganeshsanapMar 27, 2023MVP
Kev2023 You're welcome, glad it worked for you!
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.
For SharePoint/Power Platform blogs, visit: Ganesh Sanap Blogs