SharePoint List conditional formatting MultiChoice field

Fernando Juan Jarque 20 Reputation points
2023-10-18T13:27:54.14+00:00

I have a question I hope someone has the solution. I created a SharePoint list with a multi-choice field called "Equipo" that can take several values at the same time. I have tried the following:

"background-color": "=if([$Equipo]=='FA','#FFF3D6',if([$Equipo]=='GC','#DEF7EB','#E7E7EE'))"

It worked when "Equipo" was a Choice field. However, I needed this field to be multi-choice, and now it is not working. I would like that if Equipo has one option, card looks with a particular color. Otherwise (several options selected), in white.

Where is the issue?

Thanks in advance

Microsoft 365 and Office | SharePoint | For business | Windows
0 comments No comments
{count} votes

Answer accepted by question author
  1. Emily Du-MSFT 51,941 Reputation points Microsoft External Staff
    2023-10-19T07:54:34.34+00:00

    Hi @Fernando Juan Jarque

    I'm glad to hear you solve the problem and thanks for your sharing!

    By the way, since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others.". So, I would make a brief summary of this thread.

    You could click the "Accept Answer" button for this summary to close this thread, and this can make it easier for other community members to see the useful information when reading this thread. Thanks for your understanding!

    [SharePoint List conditional formatting MultiChoice field]

    Issue Symptom:

    OP created a SharePoint list with a multi-choice field called "Equipo" that can take several values at the same time. OP have tried the following:

    "background-color": "=if([$Equipo]=='FA','#FFF3D6',if([$Equipo]=='GC','#DEF7EB','#E7E7EE'))"
    

    It worked when "Equipo" was a Choice field. However, OP needed this field to be multi-choice, and now it is not working. OP would like that if Equipo has one option, card looks with a particular color. Otherwise (several options selected), in white.

    Current status:

    OP found the solution.

    "background-color": "=if(length([$Equipo])>1,'#EFF1F4',if(indexOf(join([$Equipo],''),'Team1') != -1,'#EFFBF0',if(indexOf(join([$Equipo],''),'Team2') != -1,'#EEF5FC',if(indexOf(join([$Equipo],''),'Team3') != -1,'#F2EFF7',if(indexOf(join([$Equipo],''),'Team4') != -1,'#FEEEEC',if(indexOf(join([$Equipo],''),'Team5') != -1,'#FFF9EB',if(indexOf(join([$Equipo],''),'Team6') != -1,'#F0FAF9',if(indexOf(join([$Equipo],''),'Team6') != -1,'#F5F5F5','#EFF1F4'))))))))"
    
    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Emily Du-MSFT 51,941 Reputation points Microsoft External Staff
    2023-10-19T05:25:09.83+00:00

    Whether you want to set background color for each choice value or entire choice column?

    1.For each choice value, click the column -> Column settings -> Format this column -> Edit styles -> Choose color.

    1

    2.For entire choice column, currently, JSON formatting does not support setting background color for multi-choice column.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.