Forum Discussion
444456464
Jan 21, 2022Copper Contributor
Compare 2 columns of a Sharepoint list
Hello, I would like to compare the "Estimation" column with the "Temps passe" column if the "Statut" column is selected as "Terminée" with this method : https://docs.microsoft.com/en-us/sharepoint/...
- Jan 22, 2022
444456464 try the following:
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "div", "attributes": { "class": "=if([$Statuit] == 'Terminée' && @currentField > [$Estimation], 'sp-field-trending--up', if([$Statuit] == 'Terminée' && @currentField < [$Estimation], 'sp-field-trending--down', ''))" }, "children": [ { "elmType": "span", "style": { "display": "inline-block", "padding": "0 4px" }, "attributes": { "iconName": "=if([$Statuit] == 'Terminée' && [$Tempspasse] > [$Estimation], 'SortUp', if([$Statuit] == 'Terminée' && [$Tempspasse] < [$Estimation], 'SortDown', ''))" } }, { "elmType": "span", "txtContent": "[$Tempspasse]" } ] }
which results in:
Rob
Los Gallardos
Intranet, SharePoint and Power Platform Manager (and classic 1967 Morris Traveller driver)
RobElliott
Jan 22, 2022Silver Contributor
444456464 try the following:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"attributes": {
"class": "=if([$Statuit] == 'Terminée' && @currentField > [$Estimation], 'sp-field-trending--up', if([$Statuit] == 'Terminée' && @currentField < [$Estimation], 'sp-field-trending--down', ''))"
},
"children": [
{
"elmType": "span",
"style": {
"display": "inline-block",
"padding": "0 4px"
},
"attributes": {
"iconName": "=if([$Statuit] == 'Terminée' && [$Tempspasse] > [$Estimation], 'SortUp', if([$Statuit] == 'Terminée' && [$Tempspasse] < [$Estimation], 'SortDown', ''))"
}
},
{
"elmType": "span",
"txtContent": "[$Tempspasse]"
}
]
}
which results in:
Rob
Los Gallardos
Intranet, SharePoint and Power Platform Manager (and classic 1967 Morris Traveller driver)
444456464
Feb 14, 2022Copper Contributor
Thank you so much !