Forum Discussion
JSON format question
- May 21, 2021
Teeroy_Lyon Yes, you can do this using JSON formatting like below:
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "div", "txtContent": "='REQ' + if([$ID] < 10, '00000', if([$ID] < 100, '0000', if([$ID] < 1000, '000', if([$ID] < 10000, '00',if([$ID] < 100000, '0', ''))))) + [$ID]" }Output:
Note: You need to adjust the leading zeros using nested if conditions based on your requirements.
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.
Hey ganeshsanap,
That's awesome and a pretty cool solution. I'll give that a try!
Cheers, and thanks,
Troy
Teeroy_Lyon You're welcome.
Try it & let me know if it works for you or if you face any issue while using the JSON.
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.
- Teeroy_LyonMay 27, 2021Copper Contributor
ganeshsanap , this worked perfectly...thanks for the guidance!