JSON Column Format to display Todays Date based on Current Status

%3CLINGO-SUB%20id%3D%22lingo-sub-1102338%22%20slang%3D%22en-US%22%3EJSON%20Column%20Format%20to%20display%20Todays%20Date%20based%20on%20Current%20Status%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1102338%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20formatted%20the%20following%20JSON%20so%20it%20displays%20Today%C2%B4s%20date%20only%20if%20the%20status%20of%20a%20task%20is%20different%20than%20%22Completed%22.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%C2%B4m%20planning%20on%20comparing%20that%20value%20to%20the%20due%20date%20in%20order%20to%20determine%20the%20difference%20in%20days%20between%20the%202%20columns.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHowever%2C%20the%20results%20of%20the%20JSON%20displays%20the%20date%20and%20time%20and%20I%20need%20the%20DATE%20only.%20Question%3A%20What%20do%20I%20need%20to%20do%20in%20order%20to%20retrieve%20just%20today%C2%B4s%20date%20without%20the%20time%20information%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%7B%3CBR%20%2F%3E%22elmType%22%3A%20%22div%22%2C%3CBR%20%2F%3E%22style%22%3A%20%7B%3CBR%20%2F%3E%22padding%22%3A%20%220%201px%22%3CBR%20%2F%3E%7D%2C%3CBR%20%2F%3E%22attributes%22%3A%20%7B%3CBR%20%2F%3E%22class%22%3A%20%7B%3CBR%20%2F%3E%22operator%22%3A%20%22%3A%22%2C%3CBR%20%2F%3E%22operands%22%3A%20%5B%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%22operator%22%3A%20%22%3D%3D%22%2C%3CBR%20%2F%3E%22operands%22%3A%20%5B%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%22operator%22%3A%20%22toLowerCase%22%2C%3CBR%20%2F%3E%22operands%22%3A%20%5B%3CBR%20%2F%3E%22%5B%24Status%5D%22%3CBR%20%2F%3E%5D%3CBR%20%2F%3E%7D%2C%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%22operator%22%3A%20%22toLowerCase%22%2C%3CBR%20%2F%3E%22operands%22%3A%20%5B%3CBR%20%2F%3E%22Completed%22%3CBR%20%2F%3E%5D%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%5D%3CBR%20%2F%3E%7D%2C%3CBR%20%2F%3E%22%40currentField%22%2C%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%22operator%22%3A%20%22%3A%22%2C%3CBR%20%2F%3E%22operands%22%3A%20%5B%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%22operator%22%3A%20%22%3D%3D%22%2C%3CBR%20%2F%3E%22operands%22%3A%20%5B%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%22operator%22%3A%20%22toLowerCase%22%2C%3CBR%20%2F%3E%22operands%22%3A%20%5B%3CBR%20%2F%3E%22%5B%24Status%5D%22%3CBR%20%2F%3E%5D%3CBR%20%2F%3E%7D%2C%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%22operator%22%3A%20%22toLowerCase%22%2C%3CBR%20%2F%3E%22operands%22%3A%20%5B%3CBR%20%2F%3E%22In%20progress%22%3CBR%20%2F%3E%5D%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%5D%3CBR%20%2F%3E%7D%2C%3CBR%20%2F%3E%22%40now%22%2C%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%22operator%22%3A%20%22%3A%22%2C%3CBR%20%2F%3E%22operands%22%3A%20%5B%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%22operator%22%3A%20%22!%3D%22%2C%3CBR%20%2F%3E%22operands%22%3A%20%5B%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%22operator%22%3A%20%22toLowerCase%22%2C%3CBR%20%2F%3E%22operands%22%3A%20%5B%3CBR%20%2F%3E%22%40currentField%22%3CBR%20%2F%3E%5D%3CBR%20%2F%3E%7D%2C%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%22operator%22%3A%20%22toLowerCase%22%2C%3CBR%20%2F%3E%22operands%22%3A%20%5B%3CBR%20%2F%3E%22Completated%22%3CBR%20%2F%3E%5D%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%5D%3CBR%20%2F%3E%7D%2C%3CBR%20%2F%3E%22%40now%22%2C%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%22operator%22%3A%20%22%3A%22%2C%3CBR%20%2F%3E%22operands%22%3A%20%5B%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%22operator%22%3A%20%22%3D%3D%22%2C%3CBR%20%2F%3E%22operands%22%3A%20%5B%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%22operator%22%3A%20%22toLowerCase%22%2C%3CBR%20%2F%3E%22operands%22%3A%20%5B%3CBR%20%2F%3E%22%40currentField%22%3CBR%20%2F%3E%5D%3CBR%20%2F%3E%7D%2C%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%22operator%22%3A%20%22toLowerCase%22%2C%3CBR%20%2F%3E%22operands%22%3A%20%5B%3CBR%20%2F%3E%22Delayed%22%3CBR%20%2F%3E%5D%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%5D%3CBR%20%2F%3E%7D%2C%3CBR%20%2F%3E%22%40now%22%2C%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%22operator%22%3A%20%22%3A%22%2C%3CBR%20%2F%3E%22operands%22%3A%20%5B%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%22operator%22%3A%20%22%3D%3D%22%2C%3CBR%20%2F%3E%22operands%22%3A%20%5B%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%22operator%22%3A%20%22toLowerCase%22%2C%3CBR%20%2F%3E%22operands%22%3A%20%5B%3CBR%20%2F%3E%22%40currentField%22%3CBR%20%2F%3E%5D%3CBR%20%2F%3E%7D%2C%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%22operator%22%3A%20%22toLowerCase%22%2C%3CBR%20%2F%3E%22operands%22%3A%20%5B%3CBR%20%2F%3E%22Waiting%20on%20someone%20else%22%3CBR%20%2F%3E%5D%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%5D%3CBR%20%2F%3E%7D%2C%3CBR%20%2F%3E%3CSTRONG%3E%22%40now%22%2C%3C%2FSTRONG%3E%3CBR%20%2F%3E%22%22%3CBR%20%2F%3E%5D%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%5D%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%5D%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%5D%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%5D%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%7D%2C%3CBR%20%2F%3E%3CSTRONG%3E%22txtContent%22%3A%20%22%40now%22%3C%2FSTRONG%3E%3CBR%20%2F%3E%7D%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

Hi,

 

I have formatted the following JSON so it displays Today´s date only if the status of a task is different than "Completed".

 

I´m planning on comparing that value to the due date in order to determine the difference in days between the 2 columns.

 

However, the results of the JSON displays the date and time and I need the DATE only. Question: What do I need to do in order to retrieve just today´s date without the time information:

 

{
"elmType": "div",
"style": {
"padding": "0 1px"
},
"attributes": {
"class": {
"operator": ":",
"operands": [
{
"operator": "==",
"operands": [
{
"operator": "toLowerCase",
"operands": [
"[$Status]"
]
},
{
"operator": "toLowerCase",
"operands": [
"Completed"
]
}
]
},
"@currentField",
{
"operator": ":",
"operands": [
{
"operator": "==",
"operands": [
{
"operator": "toLowerCase",
"operands": [
"[$Status]"
]
},
{
"operator": "toLowerCase",
"operands": [
"In progress"
]
}
]
},
"@now",
{
"operator": ":",
"operands": [
{
"operator": "!=",
"operands": [
{
"operator": "toLowerCase",
"operands": [
"@currentField"
]
},
{
"operator": "toLowerCase",
"operands": [
"Completated"
]
}
]
},
"@now",
{
"operator": ":",
"operands": [
{
"operator": "==",
"operands": [
{
"operator": "toLowerCase",
"operands": [
"@currentField"
]
},
{
"operator": "toLowerCase",
"operands": [
"Delayed"
]
}
]
},
"@now",
{
"operator": ":",
"operands": [
{
"operator": "==",
"operands": [
{
"operator": "toLowerCase",
"operands": [
"@currentField"
]
},
{
"operator": "toLowerCase",
"operands": [
"Waiting on someone else"
]
}
]
},
"@now",
""
]
}
]
}
]
}
]
}
]
}
},
"txtContent": "@now"
}

0 Replies