Recently Issue face in Input.date and Input.choice in AdaptiveCard

Shubham Padia 1 Reputation point
2022-03-22T06:10:03.73+00:00

While using input.choice with confirmation message in adaptive card rest at that time dropdown of choice list is not showing up, we started facing this problem recently before it was working properly.
This was the code we were using at first when it was having proper behaviour

   TeamsAdaptiveCardRest adaptiveCardRest = new TeamsAdaptiveCardRest();  

    List<TeamsItemsChoiceRest> choiceList =  
            createTeamsItemChoiceRestList((MapUserMessageRest) chatUserResponse.getOptions());  

    TeamsTextBlockRest textBlock = new TeamsTextBlockRest();  
    textBlock.setText(chatUserResponse.getMessage());  

    TeamsStaticItemListRest staticItemListRest = new TeamsStaticItemListRest();  
    staticItemListRest.setChoices(choiceList);  
    staticItemListRest.setPlaceholder("select");  
    staticItemListRest.setId(String.valueOf(chatUserResponse.getChatBrainId()));  

    TeamsToggleElementsRest enableConfirmationMessage = createToggleElements("confirmationToggle", true);  
    TeamsToggleElementsRest enableActionButton = createToggleElements("actionButton", true);  

    TeamsToggleActionRest toggleSelectAction = new TeamsToggleActionRest();  
    toggleSelectAction  
            .setTargetElements(Lists.newArrayList(enableConfirmationMessage, enableActionButton));  

    TeamsContainerRest inputChoiceContainer = new TeamsContainerRest();  
    inputChoiceContainer.setVisible(true);  
    inputChoiceContainer.setItems(Lists.newArrayList(textBlock, staticItemListRest));  
    inputChoiceContainer.setSelectAction(toggleSelectAction);  
    adaptiveCardRest.addInBody(inputChoiceContainer);  

    TeamsContainerRest confirmationMessageContainer = new TeamsContainerRest();  
    confirmationMessageContainer.setItems(  
            Lists.newArrayList(new TeamsTextBlockRest(chatUserResponse.getConfirmationMessage())));  
    confirmationMessageContainer.setId("confirmationToggle");  
    confirmationMessageContainer.setVisible(false);  
    adaptiveCardRest.addInBody(confirmationMessageContainer);  

    TeamsActionSubmitRest submitAction = new TeamsActionSubmitRest("Yes");  
    TeamsToggleElementsRest disableConfirmationMessage =  
            createToggleElements("confirmationToggle", false);  
    TeamsToggleElementsRest disableActionButton = createToggleElements("actionButton", false);  

    TeamsToggleActionRest toggleDisabledAction = new TeamsToggleActionRest();  
    toggleDisabledAction  
            .setTargetElements(Lists.newArrayList(disableConfirmationMessage, disableActionButton));  
    toggleDisabledAction.setTitle("Cancel");  

    TeamsActionSetRest actionButtionSetRest = new TeamsActionSetRest();  
    actionButtionSetRest.setVisible(false);  
    actionButtionSetRest.setId("actionButton");  
    actionButtionSetRest.setActions(Lists.newArrayList(submitAction, toggleDisabledAction));  
    adaptiveCardRest.addInBody(actionButtionSetRest);  
    return adaptiveCardRest;  

Json for above code:

{
"type": "AdaptiveCard",
"version": "1.5",
"body": [
{
"type": "Container",
"id": null,
"items": [
{
"type": "TextBlock",
"text": "Input.choice",
"wrap": true
},
{
"type": "Input.ChoiceSet",
"choices": [
{
"title": "a",
"value": "aa",
"id": "aa"
}
],
"id": "39",
"value": null,
"placeholder": "select"
}
],
"selectAction": {
"type": "Action.ToggleVisibility",
"title": null,
"id": null,
"targetElements": [
{
"elementId": "confirmationToggle",
"visible": true,
"isVisible": true
},
{
"elementId": "actionButton",
"visible": true,
"isVisible": true
}
]
},
"visible": true,
"isVisible": true
},
{
"type": "Container",
"id": "confirmationToggle",
"items": [
{
"type": "TextBlock",
"text": "Are you sure?",
"wrap": true
}
],
"selectAction": null,
"visible": false,
"isVisible": false
},
{
"type": "ActionSet",
"actions": [
{
"type": "Action.Submit",
"title": "Yes",
"associatedInputs": "auto",
"data": null
},
{
"type": "Action.ToggleVisibility",
"title": "Cancel",
"id": null,
"targetElements": [
{
"elementId": "confirmationToggle",
"visible": false,
"isVisible": false
},
{
"elementId": "actionButton",
"visible": false,
"isVisible": false
}
]
}
],
"id": "actionButton",
"visible": false,
"isVisible": false
}
],
"selectAction": null,
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json"
}

We are facing same issue for input.date with confirmation message in this datepicker dropdown doesnt show.

185511-screenshot-from-2022-03-22-11-38-57.png

Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
2,913 questions
{count} votes