Forum Discussion

ShannonU1025's avatar
ShannonU1025
Copper Contributor
Oct 09, 2024

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 be completed" field.

 

It doesn't have an option that I need, but it allows me to add one. I added "Week 2" to the options, but it doesn't have the same style/appearance as the options already provided. My addition looks like plain text whereas the other options appear as color-coded buttons. Is there a way to make "Week 2" (and, subsequently, Week 3) appear the same as the options provided? See image below:

 

The color-coded buttons available vs. the plain text option I added

5 Replies

  • WeeTeck's avatar
    WeeTeck
    Copper 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"
    }
    }
    • ShannonU1025's avatar
      ShannonU1025
      Copper 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!

  • ShannonU1025 Absolutely. When adding new choices you have to add the formatting yourself afterwards. You’ll find it in the drop down menu on the column header. 

    See https://www.enjoysharepoint.com/sharepoint-modern-list-column-formatting/ for an example

    • ShannonU1025's avatar
      ShannonU1025
      Copper Contributor

      Hanne_Lauritzen Thank you so much for your response! When I went to the column customizations, I actually found there was an option to change the color of the options. It's called Choice Pills, and it allows you to add a color 😊

      • Hanne_Lauritzen's avatar
        Hanne_Lauritzen
        Iron Contributor
        Exsctly the ones you need. You can access these via customizations as well as through the format settings I referenced. Either way. Glad you found it ☺️