Forum Discussion

kellyhickman14096's avatar
kellyhickman14096
Brass Contributor
Apr 09, 2024
Solved

Formatting Issue

Can someone tell me why the data entered in a field in Forms that looks like this:

Is showing in the Sharepoint list like this:

 

April 16, 2024 - 9:00 am - 5:00 pm

April 17, 2024 - 9:00 am - 5:00 pm

April 18, 2024 - 9:00 am - 12:00 pm

April 18, 2024 - 1:00 pm - 5:00 pm

April 19, 2024 - 9:00 am - 5:00 pm

 

The list setting for that column is Rich Text Setting, Multiple Lines of Data, 6 lines for editing and a json column formatting here:

 

{"$schema":"https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json","elmType":"div","txtContent":"@currentField","style":{"background-color":{"operator":"?","operands":[{"operator":"==","operands":["@currentField","Training_x0020_Description"]},"","#FFF399"]}}}

  • I ended up fixing this myself. If anyone is interested in the fix, this json worked after switching the column list setting to Plain Text:
    {
    "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
    "elmType": "div",
    "txtContent": "=join(@currentField, '\n')",
    "style": {
    "background-color": {
    "operator": "?",
    "operands": [
    {
    "operator": "==",
    "operands": [
    "@currentField",
    "SessionSchedule"
    ]
    },
    "",
    "#FFF399"
    ]
    }
    }
    }

1 Reply

  • I ended up fixing this myself. If anyone is interested in the fix, this json worked after switching the column list setting to Plain Text:
    {
    "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
    "elmType": "div",
    "txtContent": "=join(@currentField, '\n')",
    "style": {
    "background-color": {
    "operator": "?",
    "operands": [
    {
    "operator": "==",
    "operands": [
    "@currentField",
    "SessionSchedule"
    ]
    },
    "",
    "#FFF399"
    ]
    }
    }
    }

Resources