Forum Discussion
Hogstad_Raadgivning
Apr 09, 2021Iron Contributor
Sharepoint lists - Conditional formating, multiple lines column.
Hi, Is it possible to format a columns in lists, based on a "multiple lines" eg if it it contains text, not empty. The columns name is "Kommentarer" Best regards - Geir
- Apr 09, 2021
Hogstad_Raadgivning yes this is possible and you can see this in the More... multiple lines of text column in the image below. If there is text then the background color is blue, but the background stays white if there is no text:
Put the following JSON in the advanced mode screen when you format the column:
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json", "elmType": "div", "txtContent": "@currentField", "style": { "padding-left": "14px", "background-color": "=if(@currentField != '','#4f7b95','#fffffc')", "color": "white" } }
Rob
Los Gallardos
Microsoft Power Automate Community Super User
RobElliott
Apr 09, 2021Silver Contributor
Hogstad_Raadgivning yes this is possible and you can see this in the More... multiple lines of text column in the image below. If there is text then the background color is blue, but the background stays white if there is no text:
Put the following JSON in the advanced mode screen when you format the column:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
"elmType": "div",
"txtContent": "@currentField",
"style": {
"padding-left": "14px",
"background-color": "=if(@currentField != '','#4f7b95','#fffffc')",
"color": "white"
}
}
Rob
Los Gallardos
Microsoft Power Automate Community Super User
Hogstad_Raadgivning
Apr 09, 2021Iron Contributor
Great, thank you.
Best Regards
- Geir
Best Regards
- Geir