Forum Discussion

jonboylib's avatar
jonboylib
Iron Contributor
Aug 24, 2022
Solved

SharePoint List Default Cell Value if Empty

I have a column of type Single Line of Text. When entering data, sometimes the cell will contain data, other times it won't, and can stay empty.

 

If the cell doesn't contain data, on exit/save I would like to populate the cell with "n/a".

 

How could I achieve this? Is this only possible using Power Automate?

  • This seems to work.

     

    {
        "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
        "elmType": "div",
        "txtContent": "=if([$field_1] == '', 'n/a', '@currentField')"
    }
  • jonboylib's avatar
    jonboylib
    Iron Contributor

    This seems to work.

     

    {
        "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
        "elmType": "div",
        "txtContent": "=if([$field_1] == '', 'n/a', '@currentField')"
    }

Resources