SOLVED

SPO Count column

Copper Contributor

Good morning guys, 

I kindly ask if anyone has any idea how to proceed with this challenge:

SPO List with three columns (A) Title (B) Choice or Lookup (C) Count (Number).

- Depending on the number of items selected in column (B) column (C) will display the number of items (and not the selected options).

 

I already managed to achieve this with Power Automate, however, I need something more immediate (real-time).  I do think that maybe JSON can handle this task but I have no idea how to proceed. Does anyone have any thoughts or has already done something similar? Thanks

2 Replies
best response confirmed by GabrieleBT (Copper Contributor)
Solution

@GabrieleBT Use below JSON column formatting for you count column: 

 

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "div",
  "txtContent": "=length([$ChoiceCol])"
}

 

Where ChoiceCol is the internal name of your choice column: 

ganeshsanap_0-1676540185881.pngReferenceHow to find the Internal name of columns in 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.

For SharePoint/Power Platform blogs, visit: Ganesh Sanap Blogs

Thanks man! Really appreciate! Clean and exactly what I needed.
1 best response

Accepted Solutions
best response confirmed by GabrieleBT (Copper Contributor)
Solution

@GabrieleBT Use below JSON column formatting for you count column: 

 

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "div",
  "txtContent": "=length([$ChoiceCol])"
}

 

Where ChoiceCol is the internal name of your choice column: 

ganeshsanap_0-1676540185881.pngReferenceHow to find the Internal name of columns in 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.

For SharePoint/Power Platform blogs, visit: Ganesh Sanap Blogs

View solution in original post