Forum Discussion
Conditionnal formating based on empty (or not) fields
If Status is single selection choice column, Owner is single selection person or group column and "Date is a Date & Time column, you can use JSON view formatting like below in "Advanced mode":
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",
"additionalRowClass": "=if([$Status]=='' && Number([$DueDate])==0 && [$Owner.title]=='', 'ms-bgColor-red', if([$Status]!='' && Number([$DueDate])==0 && [$Owner.title]!='','ms-bgColor-orangeLighter',if([$Status]!='' && Number([$DueDate])!=0 && [$Owner.title]!='','ms-bgColor-gray100','')))"
}
Output:
Where Status, Owner and DueDate are internal names of your SharePoint list columns. You can get the internal name of your SharePoint list columns by following this article: How to find the Internal name of columns in SharePoint Online?
Here, I have used Number([$DueDate]) == 0 to check if Date & Time column in SharePoint list is empty or not. You can find other ways to check if date & time column is empty or not using SharePoint JSON formatting at: SharePoint JSON formatting: Check if date & time column is blank/empty
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.
- Chonski950Nov 23, 2023Copper Contributor
Thanks for the help.
- ganeshsanapNov 24, 2023MVP
You are welcome. Can you please confirm if the provided solution 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.
- Chonski950Nov 27, 2023Copper Contributor
ganeshsanap In all honesty, I didn't want to bother any longer with questions since the solution provided i'm unable to work with, too technical for a beginner like me. That's why I added a new column, give a manual status to it, and the colouring will be done based on the status.