Dec 11 2019 05:38 AM
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!
Dec 11 2019 06:17 AM - edited Dec 11 2019 06:55 AM
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
To do something like setting the text color for a particular column you'd do the same:
but then in the in the format box that appears on the right you'd enter (or copy/paste) JSON code:
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:
Rob
Los Gallardos
Microsoft Power Automate Community Super User
Dec 11 2019 06:48 AM
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?
Dec 11 2019 06:56 AM
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
Dec 11 2019 06:59 AM
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.
Dec 11 2019 07:13 AM
@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
Dec 11 2019 07:45 AM
Thank you for your help with this! @RobElliott
Dec 11 2019 06:56 AM
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