Search code examples
validationbotframeworkadaptive-cards

Validation for adaptive cards


Im using adaptive cards for scheduling a meeting in teams, I'm unable to validate the content in the card as isRequired is not working. But i have seen documentation stating that isRequired will work.


Solution

  • There is currently no isRequired field in adaptive inputs, as can be seen here and here.

    You will need to use a workaround depending on your needs and your channel. If you're using a Direct Line client like Web Chat then you'll be able to provide client-side validation, but it won't be easy. Otherwise you'll probably want to validate the input in the bot code, like in the answers to Check if an input form is filled in, in a Adaptive Card and Check if an input form is filled in a Adaptive Card bot framework c#. If you're using a channel that supports message-updating then you can even change the card to indicate to the user what fields they haven't filled out.