Forum Discussion
Json Tool - Looking for a miracle!
timparsons Hi, I suppose I am looking for a tool that will show me how JSON is structured in a really
easy way. For example, I have formatted this column using the out the box tool.
Gone to advanced and copied the JSON out as per the below. Now I want to expand on it i.e. only format if the Action Status = Open and also expand on the date calculations. Actually just pasting it into this message and copying it back out has made it a little easier to understand, however, I would not know how to add in an extra condition. This is why I have said I am looking for a miracle :-)
{
"elmType": "div",
"style": {
"padding": "0 4px"
},
"attributes": {
"class": {
"operator": ":",
"operands": [
{
"operator": "==",
"operands": [
"@currentField",
""
]
},
"",
{
"operator": ":",
"operands": [
{
"operator": "<",
"operands": [
{
"operator": "Date()",
"operands": [
{
"operator": "toDateString()",
"operands": [
"@currentField"
]
}
]
},
{
"operator": "Date()",
"operands": [
{
"operator": "toDateString()",
"operands": [
"@now"
]
}
]
}
]
},
"sp-css-backgroundColor-blockingBackground50",
{
"operator": ":",
"operands": [
{
"operator": "==",
"operands": [
{
"operator": "Date()",
"operands": [
{
"operator": "toDateString()",
"operands": [
"@currentField"
]
}
]
},
{
"operator": "Date()",
"operands": [
{
"operator": "toDateString()",
"operands": [
"@now"
]
}
]
}
]
},
"sp-css-backgroundColor-errorBackground50",
{
"operator": ":",
"operands": [
{
"operator": ">",
"operands": [
{
"operator": "Date()",
"operands": [
{
"operator": "toDateString()",
"operands": [
"@currentField"
]
}
]
},
{
"operator": "Date()",
"operands": [
{
"operator": "toDateString()",
"operands": [
"@now"
]
}
]
}
]
},
"sp-css-backgroundColor-successBackground50",
""
]
}
]
}
]
}
]
}
},
"txtContent": "@currentField"
}
Let me know if it doesn't help and I'll try and find more info for you.
- Tanya DentonApr 02, 2019Iron Contributor
timparsons many thanks Tim I will have an evening of watching and learning :-)
- Apr 02, 2019Ey Tanya,
Take a look at this WebPart: https://thechriskent.com/2017/12/21/column-formatting-client-side-web-part-column-formatter/- Tanya DentonApr 02, 2019Iron Contributor
jcgonzalezmartin Hi Juan, hope this finds you well. You are my miracle! Just watched the YouTube video and I think this will help my poor frazzled brain :-) Thank you so much. Keep well.