Forum Discussion
Paul Matthews
Feb 26, 2019Brass Contributor
SharePoint View formatting incorrect when first landing on the list
I have a SharePoint list where I have applied a formatting view. It displays the row either Red, Orange, Yellow, Green depending on a date field. I have the same formatting view on 2 different views,...
- Feb 26, 2019Ey Paul,
All the times I have use the view formatting in modern SPO, I have not face the issue you are mentioning here so it could be something to the JSON you have generated or specific to your tenant
Paul Matthews
Feb 26, 2019Brass Contributor
I was wrong, it is happening on other tenants too, but the results are not all green. But they are wrong.
My Json is below.
{
"schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",
"additionalRowClass": "=if([$Advice_x0020_Status] == 'Fed back','',if([$Decision_x0020_deadline] < @now, 'ms-fontColor-neutralSecondary ms-fontColor-redDark ms-fontSize-mPlus ms-fontWeight-bold sp-field-severity--blocked',if([$Decision_x0020_deadline] <= @now + 604800000,'sp-field-severity--severeWarning ms-fontColor-neutralSecondary ms-fontWeight-bold',if([$Decision_x0020_deadline] <= @now + 2419000000,'sp-field-severity--warning','sp-field-severity--good ms-fontColor-neutralSecondary'))))"
}
Its as if @now is not registering properly at load. But when you switch view, because it is a partial load it has the @now value. I have now logged a call with Microsoft. Will update with answers.
sgrams
Jan 29, 2021Copper Contributor
Paul Matthews I'm experiencing this issue as well and wondering if there was ever a workaround other than telling my users to "reload the page until it works".
- Paul MatthewsJan 29, 2021Brass Contributor
sgrams wow this is an old post.
Are you in the UK? I found the problem lies with the locale. Never got a solution though.
Unfortunately that is the last time I actually did any work in regards to list formatting in SharePoint. I mainly work in Azure now.