Mar 10 2022 03:19 AM
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?
Mar 10 2022 03:57 AM
Mar 14 2022 05:28 AM
Mar 15 2022 01:39 AM
I attached the json for the Adaptive Card and hope that this is the manifest you're looking for.
Mar 15 2022 03:48 AM
Mar 15 2022 06:08 AM - edited Mar 15 2022 06:08 AM
@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...
Mar 15 2022 06:58 AM
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.
Mar 15 2022 07:44 AM
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.
Mar 15 2022 09:28 PM
Mar 16 2022 06:23 AM
@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"
}
}
]
}
],
Mar 16 2022 06:28 AM - edited Mar 16 2022 06:29 AM
@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.
Mar 17 2022 12:34 AM
Jul 01 2022 02:18 PM
Do you have any updates on this? We are having the same issue on Teams v. 4.10.1 (iOS 15.5).
Jul 03 2022 11:31 PM
May 03 2023 02:15 AM - edited May 03 2023 02:16 AM
@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?