Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Adaptive Cards - Require Input

Like (0) ShareShare
ReportReport
Posted on 24 Jul 2020 14:27:27 by 182

Hi All,

 

I am trying to build an adaptive card, to run in Teams, what will require the user to complete a Input.Text field.

 

 {
 "type": "Input.Text",
 "id": "RejectCommentID",
 "placeholder": "Please specify the reason.",
 "isMultiline": true
 }

 

Is there any way to require this?

 

Sean

  • GouravMadan Profile Picture
    2 on 17 Feb 2022 at 07:55:54
    Re: Adaptive Cards - Require Input

    @cdn4lf you can use the "isRequired" property in your input.Text block and make it as true.
    For more information you can refer the link: https://adaptivecards.io/explorer/Input.Text.html

  • cdn4lf Profile Picture
    182 on 24 Jul 2020 at 15:18:46
    Re: Adaptive Cards - Require Input

    no, @ChristianAbata , What I want is for the input to not allow the action.submit to work (title=send), unless there is content there.

  • ChristianAbata Profile Picture
    8,947 Most Valuable Professional on 24 Jul 2020 at 15:08:13
    Re: Adaptive Cards - Require Input

    ohh @cdn4lf  just to understand what you need is like a condition, if the users complete something in your adaptive show up the input? 

     

    Because if is sonething like that unfortunally is not possible.

  • cdn4lf Profile Picture
    182 on 24 Jul 2020 at 15:02:38
    Re: Adaptive Cards - Require Input

    @ChristianAbata Your solution doesn't require a response, it only presents an input field.  Please see my complete code.  I require the input field to be a mandatory field.

    {
     "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
     "type": "AdaptiveCard",
     "version": "1.2",
     "body": [
     {
     "type": "Container",
     "style": "emphasis",
     "items": [
     {
     "type": "ColumnSet",
     "columns": [
     {
     "type": "Column",
     "items": [
     {
     "type": "TextBlock",
     "size": "Large",
     "weight": "Bolder",
     "text": "**Fancy Title - {$root.Position}**",
     "wrap": true
     }
     ],
     "width": "stretch"
     }
     ]
     }
     ],
     "bleed": true
     },
     {
     "type": "ColumnSet",
     "id": "MentionColumnSet",
     "columns": [
     {
     "type": "Column",
     "id": "MentionColumn",
     "width": "stretch",
     "items": [
     {
     "type": "TextBlock",
     "id": "MentionTextBlock2",
     "spacing": "None",
     "isSubtle": true,
     "wrap": true,
     "text": "Dear <at>John</at>,"
     }
     ]
     }
     ]
     },
     {
     "type": "TextBlock",
     "text": "Please help.",
     "isSubtle": true,
     "wrap": true
     },
     {
     "type": "TextBlock",
     "spacing": "Small",
     "size": "Small"
     },
     {
     "text": "Other Words.",
     "type": "TextBlock",
     "wrap": true
     },
     {
     "type": "TextBlock",
     "isSubtle": true,
     "wrap": true,
     "text": "Please click one of the boxes below to confirm"
     },
     {
     "type": "Container",
     "items": [
     {
     "type": "ActionSet",
     "actions": [
     {
     "type": "Action.Submit",
     "title": "Approve",
     "style": "positive",
     "data": {
     "id": "_qkQW8dJlUeLVi7ZMEzYVw",
     "action": "approve"
     }
     },
     {
     "type": "Action.ShowCard",
     "title": "Reject",
     "style": "destructive",
     "card": {
     "type": "AdaptiveCard",
     "body": [
     {
     "type": "TextBlock",
     "isSubtle": true,
     "wrap": true,
     "text": "Words."
     },
     {
     "type": "TextBlock",
     "isSubtle": true,
     "wrap": true,
     "text": "More Words."
     },
     {
     "type": "TextBlock",
     "isSubtle": true,
     "wrap": true,
     "text": "Explanation."
     },
     {
     "type": "TextBlock",
     "isSubtle": true,
     "wrap": true,
     "text": "Explanation Paragraph."
     },
     {
     "type": "Input.Text",
     "id": "RejectCommentID",
     "placeholder": "Please specify the reason.",
     "isMultiline": true,
     "validation": {
     "necessity": "required",
     "errorMessage": "A reason for declining is required"
     }
     }
     ],
     "actions": [
     {
     "type": "Action.Submit",
     "title": "Send",
     "data": {
     "id": "_qkQW8dJlUeLVi7ZMEzYVw",
     "action": "reject"
     }
     }
     ],
     "$schema": "http://adaptivecards.io/schemas/adaptive-card.json"
     }
     }
     ]
     }
     ]
     }
     ],
     "msteams": {
     "entities": [
     {
     "type": "mention",
     "text": "<at>John</at>",
     "mentioned": {
     "id": "8:orgid:{$root.id}",
     "name": "{$root.Name} {$root.Surname}"
     }
     }
     ]
     }
    }
  • ChristianAbata Profile Picture
    8,947 Most Valuable Professional on 24 Jul 2020 at 14:53:20
    Re: Adaptive Cards - Require Input

    yes @cdn4lf please try to use this complete json

     

    {
     "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
     "type": "AdaptiveCard",
     "version": "1.2",
     "body": [
     {
     "type": "ColumnSet",
     "columns": [
     {
     "type": "Column",
     "width": 2,
     "items": [
     {
     "type": "TextBlock",
     "text": "${title}",
     "weight": "Bolder",
     "size": "Medium"
     },
     {
     "type": "Container",
     "$data": "${properties}",
     "items": [
     {
     "type": "Input.Text",
     "id": "Response",
     "placeholder": "${placeholder}"
     }
     ]
     }
     ]
     }
     ]
     }
     ],
     "actions": [
     {
     "type": "Action.Submit",
     "title": "Submit"
     }
     ]
    }

     

    and the action is

     

    teamspost.PNG

     

    you are going to be able to use the user response by using the name of the id input 😉 hope this can helps

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Automate - Building Flows

#1
David_MA Profile Picture

David_MA 212 Super User 2025 Season 1

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 208 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 182

Overall leaderboard
Loading started