Adaptive Card not sending data on iOS Teams app

Copper Contributor

Hi there,

I´m experiencing an issue with an Adaptive Card not sending back any user entered data to the bot through Action.Execute. The action works in the browser, the Teams desktop app and the Teams app on Android. The only one that fails is the Teams app on iOS:

Version: 4.4.0

Build: 4.4.77.2022042801/0307 (general)

Release Branch: 2022Feb-T2

 

The card contains an input field defined this way:

 

{
            "type": "Input.Text",
            "placeholder": "Kommentar...",
            "isMultiline": true,
            "maxLength": 255,
            "id": "InputComment",
            "$when": "${$root.IsReply ==false}"
}

 

And action buttons defined this way:

 

{
                                    "type": "ActionSet",
                                    "actions": [
                                        {
                                            "type": "Action.Execute",
                                            "title": "Genehmigen",
                                            "verb": "approve"
                                        },
                                        {
                                            "type": "Action.Execute",
                                            "title": "Ablehnen",
                                            "verb": "deny"
                                        }
                                    ],
                                    "$when": "${$root.IsReply == false}"
                                }
                            ]
}

 

In the OnInvokeActivityAsync method I'm trying to read the data from 

turnContext.Activity.Value.action.data.InputComment

but that fails when the action was executed on iOS because then the action node doesn't contain the member 'data'.

As that doesn't happen on other platforms i suspect a bug in the Teams iOS app.

Is there anything I can do to mitigate this?

 

14 Replies
@Christian Walling - We are looking into this I will get back to you soon.
@Christian Walling - Could you please share any sample or manifest which you refer so we can try it from our end?

@Sayali-MSFT 

I attached the json for the Adaptive Card and hope that this is the manifest you're looking for.

 

@Christian Walling- We are checking it from our end and let you know.

@Christian Walling-We are unable to repro the scenario. It's working fine for us. Could you please update the IOS version if not updated then check it once?
Version: 4.4.0
Build: 4.4.77.2022042801/0307 (general)
Release Branch: 2022Feb-T2
IOS Version -15.3
Reference sample:-Microsoft-Teams-Samples/samples/bot-sequential-flow-adaptive-cards/csharp/SequentialUserSpecificFlow...

@Sayali-MSFT 

I'm on iOS 15.3.1

 

protected override async Task<InvokeResponse> OnInvokeActivityAsync(ITurnContext<IInvokeActivity> turnContext, CancellationToken cancellationToken)
        {
            if (turnContext.Activity.Name == "adaptiveCard/action")
            {
                await turnContext.SendActivityAsync(new Activity { Type = ActivityTypes.Typing }, cancellationToken);
                ChatActivities chat = new ChatActivities(this._appId, this._appPassword);
                KeyVaultHelper keyVault = new KeyVaultHelper();
                TableStorageHelper table = new TableStorageHelper(keyVault, turnContext.Activity.Conversation.TenantId);

                
                dynamic request = turnContext.Activity.Value;
                string comment = (request.action.data.InputComment == null) ? "" : request.action.data.InputComment;

The last line (12) is the one where it crashes because request.action.data is null. (Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: Cannot perform runtime binding on a null reference). It is always null when sent from the iOS app, if I type in a comment or leave the field empty. It's also independent of the action button I'm using.

@Sayali-MSFT 

ok I found the difference between your example and my code:

In the example there's always a "data" node in the action which I didn't have. Therefore I added a dummy value to the action:

{
                      "type": "Action.Execute",
                      "title": "Genehmigen",
                      "verb": "approve",
                      "data": {
                        "Dummy":  "Dummy"
                      }
}

And now the iOS app sends the comment from the input back to the bot. For now I'm going to add that dummy value to all actions as a workaround as it doesn't seem to interfere with the overall operation of the bot.

If you remove the "data" part from the action in "firstCard.json" in your example app, you should run into the same problem that I had.

 

 

@Christian Walling-We are checking on it and let you know.

@Christian Walling  -As per mention above. I can add the dummy data in data section.We are not able to reproduce the issue. It works fine.

Is there need to change anything else?

 {
      "type": "ActionSet",
      "actions": [
        {
          "type": "Action.Execute",
          "verb": "firstCard",
          "title": "Submit",
          "data": {
            "Dummy": "Dummy"
          }
        }
      ]
    }
  ],

 

MicrosoftTeams-image (17).png

@Sayali-MSFT Yes, as I've written it works if you add the dummy data. You need to fully remove the "data": {} node from the action to see the error.

@Christian Walling - We are able to repro that issue, we have raised bug for the same and concerned team is looking into it. We will inform you once we get any update.

@Sayali-MSFT 

Do you have any updates on this? We are having the same issue on Teams v. 4.10.1 (iOS 15.5).

@bt-ag-Currently we don’t have ETA or Update on this thread. We will update this thread once the bug is fixed.

@Christian Walling,@bt-ag-Got the reply from engineering team that, "Looks like the data received from web or iOS are same. Please refer the below screenshot. Let us know if you still see the issue."
IOS-16.4.1
Teams Version-5.7.77.2023073202/0421(general)
Could you please check it once and let us know?
ios2.pngios1.png