AdaptiveCards icon indicating copy to clipboard operation
AdaptiveCards copied to clipboard

Card validations are not working

Open KoradaRajesh opened this issue 6 years ago • 11 comments

I have tried to do Validations in card, it's working only in emulator but I need these validations to be work in msteams and webchat and some other channels. The below two type of templates I have used with version 1.2


{
  "type": "AdaptiveCard",
  "inputNecessityIndicators": "requiredInputs",
  "displayInputSuccessIndicators": true,
  "version": "1.2",
  "body": [
    {
      "type": "TextBlock",
      "text": "Please confirm your username"
    },
    {
      "type": "Input.Text",
      "id": "username",
      "placeholder": "Username",
      "isRequired": true,
      "regex": "^\\w{5,50}$",
      "errorMessage": "Username must be between 5 and 50 characters long."
    },
    {
      "type": "Input.Toggle",
      "id": "accept",
      "title": "I accept the policy",
      "isRequired": true,
      "errorMessage": "You must accept the policy."
    }
  ],
  "actions": [
    {
      "type": "Action.Submit",
      "title": "Confirm",
      "data": "action=confirm"
    },
    {
      "type": "Action.Submit",
      "title": "Cancel",
      "data": "action=cancel",
      "ignoreInputValidation": true
    }
  ]
}

{
    "type": "AdaptiveCard",
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "version": "1.2",
    "body": [
        {
            "type": "Container",
            "items": [
                {
                    "type": "Container",
                    "items": [
                        {
                            "text": "Fill the following properties",
                            "type": "TextBlock"
                        }
                    ]
                }
            ]
        },
        {
            "type": "Container",
            "items": [
                {
                    "placeholder": "enter email",
                    "type": "Input.Text",
                    "id": "email",
                    "validation":{
                        "necessity":"required",
                        "errorMessage":"email is Required"
                    }
                }
            ]
        },
        {
            "type": "Container",
            "items": [
                {
                    "placeholder": "enter phone numer",
                    "type": "Input.Text",
                    "id": "phonenumber",
                    "validation":{
                        "necessity":"required",
                        "errorMessage":"Phone number is Required"
                    }
                }
            ]
        }
    ]
}

KoradaRajesh avatar May 22 '20 15:05 KoradaRajesh

@dclaux / @almedina-ms / @matthidinger for visibility here in case I am misunderstanding the "Validations" reference here but @KoradaRajesh we don't yet support card validation natively in AdaptiveCards but that feature is in the works and should be out sometime next month. You can see the current status of the feature here.

shalinijoshi19 avatar Jun 04 '20 19:06 shalinijoshi19

Sure @shalinijoshi19 Thank you!

KoradaRajesh avatar Jun 05 '20 06:06 KoradaRajesh

@siduppal / @Wajeed-msft any updates on expected upgrade timelines for Teams to pick up the 1.3 schema at all? Thanks!

shalinijoshi19 avatar Sep 21 '20 20:09 shalinijoshi19

The team is actively working on updating the features but currently we cant give an ETA on when it will be available.

VaraPrasad-MSFT avatar Sep 22 '20 14:09 VaraPrasad-MSFT

PLease mention here once it get updated.

KoradaRajesh avatar Sep 23 '20 06:09 KoradaRajesh

@shalinijoshi19 @VaraPrasad-MSFT any updates on this issue ? or maybe expected timelines for 1.3 schema release? Thank you!

mpodhornyi avatar Oct 20 '20 23:10 mpodhornyi

@mpodhornyi , Currently we don't have any ETA to share when it will be in GA.

VaraPrasad-MSFT avatar Oct 21 '20 22:10 VaraPrasad-MSFT

@KoradaRajesh @andrewleader How do we add regex for email validation?

"validation":{
    "necessity":"required",
    "errorMessage":"email is Required"
}

kiranupadhyak avatar May 14 '21 05:05 kiranupadhyak

@VaraPrasad-MSFT @Wajeed-msft - Any update on the resolution of this issue? It's open for quite some time now... Please share an ETA for resolution.

prchanda avatar Jul 15 '21 14:07 prchanda

sorry i don't know all the issues


From: prchanda @.> Sent: 15 July 2021 22:49 To: microsoft/AdaptiveCards @.> Cc: Subscribed @.***> Subject: Re: [microsoft/AdaptiveCards] Card validations are not working (#4050)

@VaraPrasad-MSFThttps://github.com/VaraPrasad-MSFT @Wajeed-msfthttps://github.com/Wajeed-msft - Any update on the resolution of this issue? It's open for quite some time now... Please share an ETA for resolution.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/microsoft/AdaptiveCards/issues/4050#issuecomment-880757472, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ARYQKHWQNUWZRDAZA332BFTTX3YO7ANCNFSM4NH35GSQ.

muhamadizzuddin avatar Jul 16 '21 00:07 muhamadizzuddin

Currently there are no updates on this which I can share.

Wajeed-msft avatar Jul 17 '21 12:07 Wajeed-msft