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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / Building an adaptive c...
Copilot Studio
Unanswered

Building an adaptive card and trying to use "only show when" logic but it doesn't work

(1) ShareShare
ReportReport
Posted on by 34
I'm making an adaptive card for Copilot studio to create a small form the user must complete at the start of the conversation.
I am trying to build two different choice input's that will be hidden initially and only be shown based on a choice.
The choice is to show option 1 if the user chooses "Create a new user" and show option 2 if they select anything other than "Create a new user".
 
Below is the JSON of the full adaptive card. It is displaying both options regardless of what choice is made.
 
{
    "type": "AdaptiveCard",
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "version": "1.3",
    "body": [
        {
            "type": "TextBlock",
            "text": "Hi, I'm Alice your Virtual Assistant.\n\nPlease answer the below questions so I can help you with your query.",
            "wrap": true,
            "id": "text",
            "fontType": "Default",
            "size": "Medium",
            "weight": "Bolder"
        },
        {
            "type": "TextBlock",
            "text": "If you are making a request for someone else or requesting a new account, use their details when filling in the form not your own.",
            "wrap": true,
            "id": "text2"
        },
        {
            "type": "Input.ChoiceSet",
            "choices": [
                {
                    "title": "Myself",
                    "value": "Myself"
                },
                {
                    "title": "Someone else",
                    "value": "Someone else"
                }
            ],
            "placeholder": "Placeholder text",
            "id": "requester",
            "label": "Who are you raising the request for?",
            "style": "expanded",
            "isRequired": true,
            "errorMessage": "This information is required for your request."
        },
        {
            "type": "Input.Text",
            "placeholder": "example@example.com",
            "id": "email",
            "label": "Please enter the email address associated with the account:",
            "isRequired": true,
            "errorMessage": "This information is required for your request."
        },
        {
            "type": "Input.ChoiceSet",
            "choices": [
                {
                    "title": "Password reset",
                    "value": "Password reset"
                },
                {
                    "title": "Reactivate account",
                    "value": "Reactivate account"
                },
                {
                    "title": "Create a new user",
                    "value": "Create a new user"
                },
                {
                    "title": "Course reset",
                    "value": "Course reset"
                },
                {
                    "title": "Can't attend or need to reschedule a session",
                    "value": "Can't attend or need to reschedule a session"
                },
                {
                    "title": "Change account details",
                    "value": "Change account details"
                },
                {
                    "title": "I've completed my training, what now?",
                    "value": "I've completed my training, what now?"
                },
                {
                    "title": "My training is due to expire",
                    "value": "My training is due to expire"
                },
                {
                    "title": "My course is not showing that I attended",
                    "value": "My course is not showing that I attended"
                },
                {
                    "title": "I haven't received my certificate",
                    "value": "I haven't received my certificate"
                },
                {
                    "title": "The name on my certificate is wrong",
                    "value": "The name on my certificate is wrong"
                },
                {
                    "title": "I need help with Oliver McGowan Mandatory Training",
                    "value": "I need help with Oliver McGowan Mandatory Training"
                },
                {
                    "title": "I'm having trouble progressing to the assessment",
                    "value": "I'm having trouble progressing to the assessment"
                },
                {
                    "title": "Other",
                    "value": "Other"
                }
            ],
            "placeholder": "Please select from the dropdown",
            "label": "What do you need help with today?",
            "isRequired": true,
            "errorMessage": "This information is required for your request.",
            "id": "request_type"
        },
        {
            "type": "Input.ChoiceSet",
            "choices": [
                {
                    "title": "Standard (Learner account)",
                    "value": "Learner"
                },
                {
                    "title": "Admin",
                    "value": "Admin"
                }
            ],
            "placeholder": "Placeholder text",
            "id": "account",
            "label": "What type of account do you have?",
            "style": "expanded",
            "isRequired": true,
            "errorMessage": "This information is required for your request."
        },
        {
            "type": "Input.ChoiceSet",
            "choices": [
                {
                    "title": "1",
                    "value": "1"
                },
                {
                    "title": "2",
                    "value": "2"
                }
            ],
            "placeholder": "Please select from the dropdown",
            "id": "branch",
            "label": "Who does the account holder work for?",
            "isRequired": true,
            "errorMessage": "This information is required for your request.",
            "$when": "${request_type != 'Create a new user'}"
        },
        {
            "type": "Input.ChoiceSet",
            "choices": [
                {
                    "title": "1",
                    "value": "1"
                },
                {
                    "title": "1",
                    "value": "1"
                }
            ],
            "placeholder": "Please select from the dropdown",
            "$when":"${request_type == 'Create a new user'}",
            "id": "newuser_branch",
            "label": "Please choose the brand for the new account:",
            "isRequired": true,
            "errorMessage": "This information is required for your request. "
        },
        {
            "type": "ActionSet",
            "id": "action",
            "actions": [
                {
                    "type": "Action.Submit",
                    "title": "Submit",
                    "id": "submit",
                    "style": "positive"
                }
            ]
        }
    ]
}
 
Categories:
I have the same question (6)

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Copilot Studio

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 261 Super User 2025 Season 2

#2
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 198 Super User 2025 Season 2

#3
S-Venkadesh Profile Picture

S-Venkadesh 93 Moderator

Last 30 days Overall leaderboard