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 / Show input fields depe...
Copilot Studio
Suggested Answer

Show input fields depending on value on choice set field in adaptive card - copilot studio

(1) ShareShare
ReportReport
Posted on by 16
Is there any way in adaptive cards copilot studio where depending on input choice set i need to show or hide other inputs/text block in the adaptive card. i have tried using $when but it it is showing - [Parsing] Unknown property "$when". I tried using powerfx with isVisible property and choice set value but cant get it to work. any help is greatly appreciated. Apologies for posting the same question two as i didnt get a resolution before.
 
 
example code : 
 
{
    "type": "AdaptiveCard",
    "$schema": "https://adaptivecards.io/schemas/adaptive-card.json",
    "version": "1.5",
    "body": [
        {
            "type": "Input.ChoiceSet",
            "id": "choice",
            "choices": [
                {
                    "title": "c1",
                    "value": "c1"
                },
                {
                    "title": "c2",
                    "value": "c2"
                }
            ],
            "placeholder": "Select option",
            "value": "c1"
        },
        {
            "type": "Input.Text",
            "id": "input1",
            "label": "name",
            "placeholder": "Enter name",
            "$when": "${choice == 'c1'}"
        },
        {
            "type": "Input.Text",
            "id": "input2",
            "placeholder": "Enter phone",
            "$when": "${choice == 'c2'}"
 
        },
        {
            "type": "ActionSet",
            "actions": [
                {
                    "type": "Action.Submit",
                    "title": "Submit"
                }
            ]
        }
    ]
}
Categories:
I have the same question (0)
  • Suggested answer
    MS.Ragavendar Profile Picture
    7,171 Super User 2026 Season 1 on at
     
    Try this code.
     
    {
    
      "type": "AdaptiveCard",
    
      "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    
      "version": "1.5",
    
      "body": [
    
        {
    
          "type": "TextBlock",
    
          "text": "Select an option to provide input:",
    
          "wrap": true
    
        },
    
        {
    
          "type": "ActionSet",
    
          "actions": [
    
            {
    
              "type": "Action.ToggleVisibility",
    
              "title": "Option A",
    
              "targetElements": [
    
                {
    
                  "elementId": "inputA",
    
                  "isVisible": true
    
                },
    
                {
    
                  "elementId": "inputB",
    
                  "isVisible": false
    
                }
    
              ]
    
            },
    
            {
    
              "type": "Action.ToggleVisibility",
    
              "title": "Option B",
    
              "targetElements": [
    
                {
    
                  "elementId": "inputA",
    
                  "isVisible": false
    
                },
    
                {
    
                  "elementId": "inputB",
    
                  "isVisible": true
    
                }
    
              ]
    
            }
    
          ]
    
        },
    
        {
    
          "type": "Input.Text",
    
          "id": "inputA",
    
          "label": "Enter your name",
    
          "placeholder": "Name",
    
          "isVisible": false
    
        },
    
        {
    
          "type": "Input.Text",
    
          "id": "inputB",
    
          "label": "Enter your phone number",
    
          "placeholder": "Phone",
    
          "isVisible": false
    
        }
    
      ],
    
      "actions": [
    
        {
    
          "type": "Action.Submit",
    
          "title": "Submit"
    
        }
    
      ]
    
    }
    
    
     
     
    Please click Accept as solution if my post helped you solve your issue and help others who will face the similar issue in future.
    ❤️ Please consider giving it a Like, If the approach was useful in other ways.
    🏷️ Please tag me @MS.Ragavendar if you still have any queries related to the solution or issue persists.
  • MA-22091208-0 Profile Picture
    16 on at
    @MS.Ragavendar
     
    Thank you for taking your time to look into this but our usecase needs a choiceset not a button.
  • Suggested answer
    Arild Aarnes Profile Picture
    565 Super User 2026 Season 1 on at
    Hi,
     
    I do not think you can do that directly in a adaptive card i Copilot Studio. As far as I know the $when property is not supported, and generally, referencing other inputs for conditional visibility isn’t available.

    I've seen workarounds with splitting it into two adaptive cards, the first card with your choiceset, and then in formula mode using Power FX show the correct inputs on the second card.
     
    regards,
    Arild
  • Suggested answer
    DAnny3211 Profile Picture
    138 on at
    Hi,
    
    Currently, Adaptive Cards in Copilot Studio do not support reactive visibility based directly on the value of an `Input.ChoiceSet` within the same card. The `$when` property is not recognized in this context, which explains the parsing error you encountered.
    
    To achieve conditional visibility, the recommended approach is to use the `isVisible` property in combination with Power Fx expressions. However, this only works when the visibility is driven by **variables**, not by other inputs within the same card. In other words, you need to store the selected value from the `ChoiceSet` into a variable and then use that variable to control visibility.
    
    Here’s a simplified example using Power Fx and `isVisible`:
    
    ```json
    {
      "type": "Input.Text",
      "id": "input1",
      "label": "Name",
      "isVisible": "=If(choiceVar = \"c1\", true, false)"
    }
    ```
    
    In this case, `choiceVar` must be a variable set earlier in the conversation flow, not the ID of the `ChoiceSet` input.
    
    If you need dynamic behavior within the same card (without relying on external variables), that capability is not currently supported. You might consider using **multiple cards** or **Action.ShowCard** to simulate conditional rendering.
    
    For further reference, you can explore:
    - Adaptive Cards visibility documentation
    - [Copilot Studio Adaptive Card authoring guide](https://learn.microsoft.com/en-us/microsoft-copilot-studio/authoring-ask-with-adaptive-card)[1](https://learn.microsoft.com/en-us/microsoft-copilot-studio/authoring-ask-with-adaptive-card)
    - [Blog on dynamic visibility using Power Fx](https://www.burgersandbytes.nl/blog/20241108-adaptivecarddynamicshowhide/)[2](https://www.burgersandbytes.nl/blog/20241108-adaptivecarddynamicshowhide/)
    
    Thanks and best regards,  
    Daniele  
    **Note: This response was prepared with support from Copilot to ensure clarity and completeness.**

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 April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Copilot Studio

#1
Valantis Profile Picture

Valantis 455

#2
Vish WR Profile Picture

Vish WR 295

#3
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 212 Super User 2026 Season 1

Last 30 days Overall leaderboard