Format column json works fine in date column in document library EXCEPT first item

Copper Contributor

Hi community, and thanks in advance for your help.

I have a date column in a document library with this json format:

 

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
  "elmType": "div",
  "style": {
    "text-align": "=if(indexOf(toLowerCase('[$ContentType]'),'expediente banco') != -1, 'center','')"
  },
  "txtContent": "=if(indexOf(toLowerCase('[$ContentType]'),'expediente banco') != -1, '-----No Aplica en Expedientes-----','=toLocaleDateString(@currentField)')",
  "attributes": {
    "class": "=if(indexOf(toLowerCase('[$ContentType]'),'expediente banco') != -1, 'ms-fontColor-grey','')"
  }
}

 

It works fine except with the first item of the document library shown in any view. For example:

Isidro_ISIAN_0-1643042700320.png

Isidro_ISIAN_1-1643042754536.png

Sometimes, if I refresh the browser page this first item shows the correct date, but generally, it always shows the json formula rather thant te actual '@currentField'. The issue only occurs with the first item. 


Why is happening this odd behaviour? 
Any suggestions to fix-work around?

 

Thanks!

 

0 Replies