SOLVED

SharePoint View formatting incorrect when first landing on the list

%3CLINGO-SUB%20id%3D%22lingo-sub-356866%22%20slang%3D%22en-US%22%3ESharePoint%20View%20formatting%20incorrect%20when%20first%20landing%20on%20the%20list%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-356866%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20a%20SharePoint%20list%20where%20I%20have%20applied%20a%20formatting%20view.%20It%20displays%20the%20row%20either%20Red%2C%20Orange%2C%20Yellow%2C%20Green%20depending%20on%20a%20date%20field.%20I%20have%20the%20same%20formatting%20view%20on%202%20different%20views%2C%20and%20all%20columns%20required%20in%20the%20formatting%20view%20are%20displayed%20in%20the%20views.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHowever%2C%20when%20I%20first%20hit%20the%20default%20view%20everything%20is%20green.%20If%20I%20switch%20the%20view%20from%20one%20to%20another%2C%20and%20then%20switch%20back%20again%2C%20the%20view%20shows%20the%20correct%20colours%20for%20the%20correct%20rows.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20there%20a%20known%20bug%20regarding%20timing%20issues%20of%20loading%20the%20view%20format%3F%20Could%20there%20be%20an%20issue%20with%20my%20view%20template%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-356957%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%20View%20formatting%20incorrect%20when%20first%20landing%20on%20the%20list%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-356957%22%20slang%3D%22en-US%22%3E%3CP%3EI%20was%20wrong%2C%20it%20is%20happening%20on%20other%20tenants%20too%2C%20but%20the%20results%20are%20not%20all%20green.%20But%20they%20are%20wrong.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMy%20Json%20is%20below.%3C%2FP%3E%3CP%3E%7B%3CBR%20%2F%3E%22schema%22%3A%20%22%3CA%20href%3D%22https%3A%2F%2Fdeveloper.microsoft.com%2Fjson-schemas%2Fsp%2Fview-formatting.schema.json%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdeveloper.microsoft.com%2Fjson-schemas%2Fsp%2Fview-formatting.schema.json%3C%2FA%3E%22%2C%3CBR%20%2F%3E%22additionalRowClass%22%3A%20%22%3Dif(%5B%24Advice_x0020_Status%5D%20%3D%3D%20'Fed%20back'%2C''%2Cif(%5B%24Decision_x0020_deadline%5D%20%26lt%3B%20%40now%2C%20'ms-fontColor-neutralSecondary%20ms-fontColor-redDark%20ms-fontSize-mPlus%20ms-fontWeight-bold%20sp-field-severity--blocked'%2Cif(%5B%24Decision_x0020_deadline%5D%20%26lt%3B%3D%20%40now%20%2B%20604800000%2C'sp-field-severity--severeWarning%20ms-fontColor-neutralSecondary%20ms-fontWeight-bold'%2Cif(%5B%24Decision_x0020_deadline%5D%20%26lt%3B%3D%20%40now%20%2B%202419000000%2C'sp-field-severity--warning'%2C'sp-field-severity--good%20ms-fontColor-neutralSecondary'))))%22%3CBR%20%2F%3E%7D%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIts%20as%20if%26nbsp%3B%40now%20is%20not%20registering%20properly%20at%20load.%20But%20when%20you%20switch%20view%2C%20because%20it%20is%20a%20partial%20load%20it%20has%20the%26nbsp%3B%40now%20value.%20%26nbsp%3BI%20have%20now%20logged%20a%20call%20with%20Microsoft.%20Will%20update%20with%20answers.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-356923%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%20View%20formatting%20incorrect%20when%20first%20landing%20on%20the%20list%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-356923%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Juan%2C%3C%2FP%3E%3CP%3E%26nbsp%3BYou%20might%20be%20right.%20I%20have%20taken%20a%20pnp%20template%20of%20the%20list%20and%20applied%20to%20a%20different%20tenant%2C%20and%20added%20some%20data.%3C%2FP%3E%3CP%3EClicking%20around%20this%20new%20tenant%2C%20doesn't%20seem%20to%20be%20affecting%20the%20view%20formatting.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks.%20Looks%20like%20I%20need%20to%20make%20a%20support%20call%20to%20Microsoft%2C%20for%20my%20original%20tenant.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-356908%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%20View%20formatting%20incorrect%20when%20first%20landing%20on%20the%20list%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-356908%22%20slang%3D%22en-US%22%3EEy%20Paul%2C%3CBR%20%2F%3EAll%20the%20times%20I%20have%20use%20the%20view%20formatting%20in%20modern%20SPO%2C%20I%20have%20not%20face%20the%20issue%20you%20are%20mentioning%20here%20so%20it%20could%20be%20something%20to%20the%20JSON%20you%20have%20generated%20or%20specific%20to%20your%20tenant%3C%2FLINGO-BODY%3E
Highlighted
Contributor

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?

 

 

3 Replies
Highlighted
Best Response confirmed by Paul Matthews (Contributor)
Solution
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
Highlighted

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.

Highlighted

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.