SOLVED

List Style in Modern experience not working

Copper Contributor

Hello!

 

I have created a list with a "Shaded" Style. If the list is on Classic mode, the links are nice and blue and the shading works perfectly, but if I view the list in modern experience, all of the formatting disappears, why is that?

 

Thank you! 

link-modern-exp.PNG

link-classic-exp.PNG

  

6 Replies

Hi @yuyitax  lists in the modern experience are formatted in a different way to classic lists. For some column types you can select the formatting. Click on the dropdown arrow next to the column, select Column settings and then click Format this column
custom-format-text2.png

 

To do something like setting the text color for a particular column  you'd do the same:


custom-format-text1.png


but then in the in the format box that appears on the right you'd enter (or copy/paste) JSON code:

 

custom-format-text0.png

 

I set the color of the "County" column to a shade of blue and the JSON syntax for that was:

 

{
"$schema":
"https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
"elmType": "div",
"debugMode": true,
"txtContent": "@currentField",
"style": {
"color": "#0000ff"
}
}

 

The formatting of modern lists is more powerful than on classic lists and allows you to add, for example, buttons to trigger a flow and do other actions:
0-basic-button.png

 

2-flowJSON.png

 

Rob
Los Gallardos
Microsoft Power Automate Community Super User

 

@RobElliott 

Hi Rob, 

 

Thank you for your fast help. I tried using the blue shade code that you share but i get an error that says to use a valid column-formatting JSON. Any idea why?

clipboard_image_0.png

best response confirmed by yuyitax (Copper Contributor)
Solution

@yuyitax sorry the JSON code got changed during the copy and paste, hopefully now corrected. The code is:

{
"$schema":
"https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
"elmType": "div",
"debugMode": true,
"txtContent": "@currentField",
"style": {
"color": "#0000ff"
}
}

 

Rob
Los Gallardos
Microsoft Power Automate Community Super User

@RobElliott 

 

Thank you Rob that did fix the link coloring, but now they are not clickable, meaning they do not link to their corresponding list item. 

@yuyitax  although Microsoft say that the Title column does support column formatting, there does seem to be a problem with that. I've only ever used it on other columns.

 

Rob
Los Gallardos
Microsoft Power Automate Community Super User

Thank you for your help with this! @RobElliott 

1 best response

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

@yuyitax sorry the JSON code got changed during the copy and paste, hopefully now corrected. The code is:

{
"$schema":
"https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
"elmType": "div",
"debugMode": true,
"txtContent": "@currentField",
"style": {
"color": "#0000ff"
}
}

 

Rob
Los Gallardos
Microsoft Power Automate Community Super User

View solution in original post