Forum Discussion
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, and all columns required in the formatting view are displayed in the views.
However, when I first hit the default view everything is green. If I switch the view from one to another, and then switch back again, the view shows the correct colours for the correct rows.
Is there a known bug regarding timing issues of loading the view format? Could there be an issue with my view template?
- Ey 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
- Ey 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 MatthewsBrass Contributor
Hi Juan,
You might be right. I have taken a pnp template of the list and applied to a different tenant, and added some data.
Clicking around this new tenant, doesn't seem to be affecting the view formatting.
Thanks. Looks like I need to make a support call to Microsoft, for my original tenant.
- Paul MatthewsBrass 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.