Forum Discussion
ShannonU1025
Oct 09, 2024Copper Contributor
Customizing New Option for Complete By/Due Date By When Work Should Be Completed
I have created an employee onboarding list in SharePoint. It comes with several options (e.g., Before Joining, First Day, Week 1, After 30 Days, etc.) in the "Complete By/Due date by when work should...
WeeTeck
Oct 10, 2024Copper Contributor
Typically done via JSON column formatting in SharePoint.
Modify the JSON formatting to include the custom option.
Reference:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"txtContent": "@currentField",
"style": {
"background-color": "=if(@currentField == 'Before Joining', '#e6f7ff', if(@currentField == 'First Day', '#fff3e0', if(@currentField == 'Week 1', '#e8f5e9', if(@currentField == 'Week 2', '#ffeb3b', if(@currentField == 'Week 3', '#c8e6c9', '')))))",
"padding": "5px",
"border-radius": "3px"
}
}
Modify the JSON formatting to include the custom option.
Reference:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"txtContent": "@currentField",
"style": {
"background-color": "=if(@currentField == 'Before Joining', '#e6f7ff', if(@currentField == 'First Day', '#fff3e0', if(@currentField == 'Week 1', '#e8f5e9', if(@currentField == 'Week 2', '#ffeb3b', if(@currentField == 'Week 3', '#c8e6c9', '')))))",
"padding": "5px",
"border-radius": "3px"
}
}
ShannonU1025
Oct 10, 2024Copper Contributor
WeeTeck This is so helpful, but I noticed once I went to format the column that there is actually an option where you can customize the colors without using JSON. It's called Choice Pills, and it allows me to add a color to Week 2 and Week 3 😊 Thank you so much for your response, though! It is very helpful!