No Code Column Formatting in SharePoint – NEW
There’s a new wizard based, easy user interface for column conditional formatting in SharePoint Online!! That means you don’t have to know JSON code in order to do some conditional formatting on your columns!!!!!!
This doesn’t work on every column type, there are still limitations, but it does give some basic options.
Right now this only works on these types of columns:
- Yes/No (boolean)
It’s pretty simplistic. There are only a few ways you can format them, so if you need to do anything more complex than what you see out of box, you can still use JSON.
Here’s how the new formatting works.
Click the heading of a column, click Column settings, and choose Format this column. The one in this example, Status, is a choice column.
In the panel on the right side of the screen, the panel will have the name of your column at the top. Mine says Format Status column, because I selected the column called Status. You can click the checkbox to turn on some generic, default colors, or you can click Edit Template, to configure further. To do formatting with code instead of this wizard, click Advanced mode.
On this next screen, for a choice column, you’ll see a list of all the choices that exist for that column, with a little color palette icon next to each.
Click a color palette, and you’re presented with a set of (fairly limited) colors to pick from. You can even choose No fill if you’d like.
Configure each color if you’d like, and click Apply. At any time, click Reset to default style, to remove the conditional formatting.
For a date column, the choices are a little different. A date column will only give you three choices. By default, each one in relative to today, but you can click the drop-down on each, to change it to a specific date instead.
For a Yes/No boolean column, it’s only going to have two choices obviously, one color for Yes, and one color for No.
Here’s mine with a couple of choice columns, a date, and a yes/no, all formatted:
After formatting the columns, it’s still possible to see the code and tweak it if you’d like.
Go to list/library settings, and click the name of a column. Scroll down to see the Column Formatting box, and dig in.
That’s it for now, happy conditional formatting! Also, if you’d like to learn about this and more, check out my SharePoint Power User course!
SharePoint Power Hour: Column Formatter
SharePoint Column Formatter – GitHub
SharePoint List Formatting – GitHub
Mine only has the sort and filter options. Do I need to have my Admin update SharePoint? I am trying to do some conditional formatting
I think it’s just now rolling out. I didn’t realize it at the time that I wrote this.
Yet still no way to get rid of the comma in a number
You can, you just have to use ToString and say what the format needs to be, like in this section https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/column-formatting#create-simple-data-visualizations
This is a welcome improvement! However it does not work on the List Web Parts (still!) There is a UserVoice that others refer to that claims to have fixed this but I cannot get it to work (and this was before the ‘no-code’ version so wonder if it works with the JSON code version, even though logically you think both would either work or not work.
Wow! good article, thanks!
When I try the following code:
I get this message in the console: “could not evaluate _ModerationStatus”.
Thanks to this, your great solutions doesnt seem to work for me.
The document library has content approval turned on. 🙂
Reblogged this on JoePC.
Hi Laura, I’m loving the ease of the new formatting, however when I apply any sort of formatting to a number column the thousand seperators disapper. so 100,000 becomes 100000. Any ideas how I can prevent this from happening?
I dont see the effect in classic view once i switch from modern experience.
That is correct. Don’t use the classic view anymore.
it doesn’t look like I can use HEX colodes to substitue for the defaults (i.e. “successBackground50” ?? any other options?
You’d have to write your own CSS styles instead of using Microsoft’s built in classes.
Pingback: Json-Affichage-SharePoint | KTNN SharePoint
Great article. I still don’t see the Format Column option which would be great as I don’t want to use json. Can anyone that knows how to write a json code to add color to a column? All I wan to do is have 3 choices of Red, Yellow and Green where color would correspond to the actual color – extra credit would be to match the font color to the column color so the test “disappears”. Really would appreciate some help here for a non-coder person… 🙂
You can use this to quickly edit other types of columns. Simply create a choice column with the variable you want. Format the column as per the article. Then open the advanced settings to see the json code, copy, and then paste into the columns you want to format.
Pingback: Nouveautés début de 2020 | KTNN SharePoint
For more sample of json, if it adds value I’ve added it a list with every sample from github on my blog : https://www.collabmania.com/2017/12/03/sharepoint-online-column-formatting-options/
Hi Laura, Love this, really helpful. I have added the formatting to my list, however when I add the list to a web part on the front SharePoint page the colour doesn’t show. What am I doing wrong, obviously a rookie at this JSON formatting malarkey….
Any Help would be really welcome thanks
Hi Alison, the only thing I can think of is if the view in the web part doesn’t include a column that you may be referencing in your code. If the column isn’t in the view, the code won’t work.
Good morning. Thank you for this well thought out example. It works for most of my requirement, but I have something I can’t seem to find a solution for. I have a number field with 2 decimal places. I need help with JSON that will perform conditional formatting based on a type field I have in my list. For all types except one, I want currency and 2 decimal places. The other type field I need to strip the decimal places. Is this possible? Thank you for your time.
Sorry I know nothing about how to write JSON, I just always use Microsoft’s examples.