List with dropdown choice and multiple selections allowed

Brass Contributor

I have a sharepoint list with 6 columns.  Each column is a dropdown choice of months of the year and multiple selections are allowed.  I would like to create a view that will show me all items that have any one column with 4 or more months selected.  Is this possible?

2 Replies
This may not be possible out of the box.
Here is my thought - Create and update a numerical column for each of your drop down choices with # of options selected and use that as filter in your view. I am not sure if Power Automate can help with parsing the choice column and detecting # of options selected.

@Peggy Lang 

I haven't quite managed to hide the rows with less than 4 values across the choice fields, but did manage to highlight the rows that contained at least 4 values in any of the choice fields. Hopefully this will help a bit with the logic. It's using the length function to return the total number of items in the choice fields as they are stored as an array of values.

 

I'm not actually sure if you can hide a row without overriding all the fields in the list. I was hoping there was an ms class for hiding a row, but didn't find anything.

 

See example JSON that uses 3 choice fields (Choice1, Choice2 and Choice3) all of which contain the months of the year (January, February, March, etc.).

 

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json",
  "additionalRowClass": {
    "operator": ":",
    "operands": [
      {
        "operator": "||",
        "operands": [
          {
            "operator": "||",
            "operands": [
              {
                "operator": ">=",
                "operands": [
                  {
                    "operator": "length",
                    "operands": [
                      "[$Choice1]"
                    ]
                  },
                  4
                ]
              },
              {
                "operator": ">=",
                "operands": [
                  {
                    "operator": "length",
                    "operands": [
                      "[$Choice2]"
                    ]
                  },
                  4
                ]
              }
            ]
          },
          {
            "operator": ">=",
            "operands": [
              {
                "operator": "length",
                "operands": [
                  "[$Choice3]"
                ]
              },
              4
            ]
          }
        ]
      },
      "sp-css-backgroundColor-BgCornflowerBlue sp-field-fontSizeSmall sp-css-color-CornflowerBlueFont",
      ""
    ]
  }
}

 

An example of what it looks like below.

gjen020_1-1658668112160.png