Forum Discussion
Formatting a column into negative numbers based on response from another column
- Jul 28, 2022
Imam1375 Do you just want to just want to show the negative numbers in list view OR you want to store the negative value in actual column & use it somewhere else (custom application/power apps/power automate, etc?).
If you just want to show it in list view, you can use column formatting for this. Here's a JSON code you can use for the same:{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "div", "txtContent": "=if(indexOf(join([$MultiChoice], '|'), 'O') >=0, if(@currentField < 0, @currentField, @currentField * -1), @currentField)" }
Output:
I have added above JSON code on MyNoColumn field. Also, you have to use the internal name of your multiple selection choice column in place of MultiChoice in above code.
Follow this article to get the internal name of your SharePoint column: How 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