question

RamirezNicholas-9677 avatar image
0 Votes"
RamirezNicholas-9677 asked EchoDu-MSFT commented

Format Column in Lists based off of Dates in the Column and another Column

Hello,

I want to create a completion date column in my Sharepoint list that turns red if the date in it is past the due date. Here is what I have:

{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"txtContent": "@currentField",
"attributes": {
"class": "=if([$Completion_x0020_Date] >= [$Due_x0020_Date],'sp-field-severity--severeWarning', '')"
}
}

This code does simply turns every entry red. Has someone encountered this before?

office-sharepoint-online
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

EchoDu-MSFT avatar image
0 Votes"
EchoDu-MSFT answered EchoDu-MSFT commented

Hello @RamirezNicholas-9677 ,

Welcome to Q&A Forum!

Please check your columns' DisplayName:
List Settings>> scroll to Columns section >> click on the specific columns

95119-column-displayname.png

Here is Column Format:

 {
 "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
 "elmType": "div",
 "txtContent": "@currentField",
 "attributes": {
 "class": "=if([$DueDate] <= [$CompletionDate], 'sp-field-severity--severeWarning', '')"
 }
 }

95076-column-format.png


Thanks,
Echo Du
======================
If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.






· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @RamirezNicholas-9677 ,

Would you tell me whether your issue has been resolved or have any update?
I am looking forward to your reply.

Have a nice day!

Thanks,
Echo Du

0 Votes 0 ·

Hi @RamirezNicholas-9677 ,

Is there anything else I can help with regarding this issue?
You can comment us at any time and we will continue to follow up.

Thanks,
Echo Du

0 Votes 0 ·