Forum Discussion
Age according to DoB
MelauriePelland If you are using SharePoint online, use below schema in your JSON:
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
Example:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"txtContent": "=floor((Number(@now)-Number([$Birthday]))/(1000*60*60*24*12)/365*12)"
}
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.
- MelauriePellandMay 23, 2023Copper Contributor
ganeshsanap You do realize you just gave me the exact same JSON I already had?
- ganeshsanapMay 23, 2023MVP
MelauriePelland No, look closely at the URLs.
You were using this schema URL:
https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.jsonand I am asking you to try using this URL instead:
https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.jsonThe first URL/schema is required for SharePoint 2019 and the v2 schema is used for SharePoint online.
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.
- Thomasw1964Aug 08, 2023Copper Contributor53 always 53 ... doesn't matter which json I use... frustrating