Forum Discussion
How can users change Yes/No columns?
What are the different ways I can tell my users how to change the value of a custom Yes/No column in the browser? It looks like my options are to tell them to either check the circle in the far left column that selects the item, and then scroll down the the item's properties and check or uncheck that option (although this seems to fail sometimes for me and I don't get much of an error message) or use grid view the check or uncheck the column. Similarly in the latter option I often get an error that says the file is locked by me, even though the file is not open anywhere in my session.
Are there any other options or settings I could use to make it a little easier on users?
dgajohnson try using JSON sample given here: Yes/No Column Toggle
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
dgajohnson Try using JSON column formatting for your Yes/No column like below:
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "div", "inlineEditField": "@currentField", "txtContent": "=if(@currentField,'Yes','No')" }
This will allow users to edit the column value inline from list/table view itself without going to properties form:
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
- dgajohnsonCopper Contributor
ganeshsanap thank you, this is working!
Do you know of a way to make it so that you can change the value with only one click? With this formatting the user has to click the cell, wait for it to load, and then change its value. Do you know of a method where the user could change the value with just one click?dgajohnson try using JSON sample given here: Yes/No Column Toggle
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
- sam77meyerCopper Contributor
Is there a way to adjust this code to have it only apply to certain content types and/or apply only if another column meets a requirement?
My problem:
I have a Sharepoint list which contains both folders and excel files. With the current JSON, it automatically applies the pre-set value to all entities in the list where I only want it to show next to the excel files to avoid confusion.
sam77meyer Yes, you can hide the JSON formatting for folders using visibility or display properties inside style property.
Example:
"style": { "visibility": "=if([$ContentType] == 'Folder', 'hidden', 'visible')" },
Where ContentType is the internal name of your SharePoint list column which you have to use in this format: [$ContentType]. 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?
You may have to show the Content Type column in your library view to read it's value in JSON.
Above JSON snippet is taken from here (full JSON example available): SharePoint Online: Download files using JSON Formatting
Please consider giving a Like if my post helped you in any way.