Forum Discussion
Christian Walling
Mar 10, 2022Copper Contributor
Adaptive Card not sending data on iOS Teams app
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 Tea...
Sayali-MSFT
Microsoft
Mar 14, 2022Christian Walling - Could you please share any sample or manifest which you refer so we can try it from our end?
Christian Walling
Mar 15, 2022Copper Contributor
I attached the json for the Adaptive Card and hope that this is the manifest you're looking for.
- Sayali-MSFTMar 15, 2022
Microsoft
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 at main · OfficeDev/Microsoft-Teams-Samples (github.com)- Christian WallingMar 15, 2022Copper Contributor
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.
- Christian WallingMar 15, 2022Copper Contributor
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.
- Sayali-MSFTMar 15, 2022
Microsoft
Christian Walling- We are checking it from our end and let you know.