1

So I have the Adaptive card working in the adaptive card desiner.

The QuickView JSON is this:

{
  "type": "AdaptiveCard",
  "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
  "version": "1.0",
  "body": [
      {
          "type": "TextBlock",
          "text": "${strVacationType}",
          "wrap": true
      },
      {
          "type": "Input.ChoiceSet",
          "value": "${defaultTypeId}",
          "choices": [
              {
                  "$data": "${types}",
                  "title": "${Title}",
                  "value": "${Id}"
              }
          ],
          "placeholder": "Select Vacation Type",
          "id": "vacType"
      },
      {
          "type": "TextBlock",
          "text": "${strVacationStartDate}",
          "wrap": true
      },
      {
          "type": "Input.Date",
          "id": "vacStartDate"
      },
      {
          "type": "TextBlock",
          "text": "${strVacationEndDate}",
          "wrap": true
      },
      {
          "type": "Input.Date",
          "id": "vacEndDate"
      },
      {
          "type": "TextBlock",
          "text": "${strVacationFeeOptions}",
          "wrap": true
      },
      {
          "type": "Input.ChoiceSet",
          "value": "${feeOptions[0].key}",
          "choices": [
              {
                  "$data": "${feeOptions}",
                  "title": "${text}",
                  "value": "${key}"
              }
          ],
          "placeholder": "Placeholder text",
          "id": "vacFee"
      },
      {
          "type": "ActionSet",
          "actions": [
              {
                  "type": "Action.Submit",
                  "style": "positive",
                  "id": "vacAddSubmit",
                  "title": "${strAddVacation}"
              }
          ]
      }
  ]
}

and the data JSON is this:

{
    "strVacationType": "Type",
    "strVacationStartDate": "Start Date",
    "strVacationEndDate": "End Date",
    "strVacationFeeOptions": "Fee",
    "defaultTypeId": 1,
    "strAddVacation": "Add",
    "types": [
        {
            "Title": "Põhipuhkus",
            "vacTypeMapping": "vacType1",
            "vacTypeDefaultVal": 28,
            "Id": 1,
            "vacTypeExcludeHolidays": true,
            "vacTypeRequiredChildInfo": false
        },
        {
            "Title": "Lisapuhkus",
            "vacTypeMapping": "vacType2",
            "vacTypeDefaultVal": 0,
            "Id": 2,
            "vacTypeExcludeHolidays": true,
            "vacTypeRequiredChildInfo": false
        },
        {
            "Title": "Lapsepuhkus",
            "vacTypeMapping": "vacType3",
            "vacTypeDefaultVal": null,
            "Id": 3,
            "vacTypeExcludeHolidays": false,
            "vacTypeRequiredChildInfo": false
        },
        {
            "Title": "Lapsepuhkus tasustamata",
            "vacTypeMapping": "vacType4",
            "vacTypeDefaultVal": 0,
            "Id": 4,
            "vacTypeExcludeHolidays": false,
            "vacTypeRequiredChildInfo": false
        },
        {
            "Title": "Puudega lapse puhkus",
            "vacTypeMapping": "vacType5",
            "vacTypeDefaultVal": 0,
            "Id": 5,
            "vacTypeExcludeHolidays": false,
            "vacTypeRequiredChildInfo": false
        },
        {
            "Title": "Lapsehoolduspuhkus",
            "vacTypeMapping": "vacType6",
            "vacTypeDefaultVal": null,
            "Id": 6,
            "vacTypeExcludeHolidays": false,
            "vacTypeRequiredChildInfo": false
        },
        {
            "Title": "Isapuhkus",
            "vacTypeMapping": "vacType7",
            "vacTypeDefaultVal": 0,
            "Id": 7,
            "vacTypeExcludeHolidays": false,
            "vacTypeRequiredChildInfo": false
        },
        {
            "Title": "Töövõimetuspensionäri lisapuhkus",
            "vacTypeMapping": "vacType8",
            "vacTypeDefaultVal": 0,
            "Id": 8,
            "vacTypeExcludeHolidays": true,
            "vacTypeRequiredChildInfo": false
        },
        {
            "Title": "Õppepuhkus",
            "vacTypeMapping": "vacType9",
            "vacTypeDefaultVal": 20,
            "Id": 9,
            "vacTypeExcludeHolidays": false,
            "vacTypeRequiredChildInfo": false
        },
        {
            "Title": "Õppepuhkus tasustamata",
            "vacTypeMapping": "vacType10",
            "vacTypeDefaultVal": 10,
            "Id": 10,
            "vacTypeExcludeHolidays": false,
            "vacTypeRequiredChildInfo": false
        },
        {
            "Title": "Õppepuhkus miinimumpalgaga",
            "vacTypeMapping": "vacType11",
            "vacTypeDefaultVal": 0,
            "Id": 11,
            "vacTypeExcludeHolidays": false,
            "vacTypeRequiredChildInfo": false
        },
        {
            "Title": "Palgata puhkus",
            "vacTypeMapping": null,
            "vacTypeDefaultVal": 0,
            "Id": 12,
            "vacTypeExcludeHolidays": false,
            "vacTypeRequiredChildInfo": false
        }
    ],
    "feeOptions": [
        {
            "key": 2,
            "text": "Koos palgaga"
        },
        {
            "key": 1,
            "text": "Enne puhkust"
        }
    ]
}

But when I test out the ACE I get the following error (multiple times):

"All choices in an Input.ChoiceSet must have their title and value properties set."

As far as I can tell the ACE is set up correctly, but it does not render for me. The funny part is that when I use the sample from Microsoft here then that works as expected.

1 Answer 1

0

So after some trial and error I found the issue. The Choice takes only a string value as documented here: https://adaptivecards.io/explorer/Input.Choice.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.