web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / Adaptive Card - Count ...
Copilot Studio
Unanswered

Adaptive Card - Count Selected Items

(0) ShareShare
ReportReport
Posted on by 3
I have a choice set with Id = menu and I want to make sure that they select at least two items from that choice set.
 
I have tried multiple ways to display a message if they select less than 2 but it doesn't work.  Can anyone tell me if I can accomplish what I am trying and what the correct syntax might be:
 
 {
            "type": "Input.ChoiceSet",
            "choices": [
                {
                    "title": "Potato",
                    "value": "Potato"
                },
                {
                    "title": "Salad",
                    "value": "Salad"
                },
                {
                    "title": "French Fries",
                    "value": "French Fries"
                },
                {
                    "title": "Carrots",
                    "value": "Carrots"
                },
                {
                    "title": "Soup",
                    "value": "Soup"
                }
            ],
            "isRequired": true,
            "id": "menuSelection",
            "label": "Select at least 2:",
            "isMultiSelect": true,
            "errorMessage": "At least 2 are required"
        },
        {
            "type": "TextBlock",
            "text": "Please select at least 2 items above",
            "isVisible": "${if(countSelectedItems[menuSelection]>1,true,false)}"
            "wrap": true
        }
Categories:
I have the same question (0)
  • fchopo Profile Picture
    8,003 Moderator on at
    Hello,
    You should check that in any of the action you may have (like submit). Have a look at this sample:
    {
      "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
      "type": "AdaptiveCard",
      "version": "1.3",
      "body": [
        {
          "type": "TextBlock",
          "text": "Please select at least two options:",
          "wrap": true
        },
        {
          "type": "Input.ChoiceSet",
          "id": "choiceSet",
          "isMultiSelect": true,
          "style": "expanded",
          "choices": [
            {
              "title": "Option 1",
              "value": "1"
            },
            {
              "title": "Option 2",
              "value": "2"
            },
            {
              "title": "Option 3",
              "value": "3"
            },
            {
              "title": "Option 4",
              "value": "4"
            }
          ]
        }
      ],
      "actions": [
        {
          "type": "Action.Submit",
          "title": "Submit",
          "data": {
            "minSelection": 2
          }
        }
      ]
    }
    There's a "data" attribute and setting the "minSelection" to 2.
     
    Hope that helps!
    Ferran

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Copilot Studio

#1
Valantis Profile Picture

Valantis 704

#2
Vish WR Profile Picture

Vish WR 249

#3
Haque Profile Picture

Haque 244

Last 30 days Overall leaderboard