Forum Discussion
Pass adaptive card meta data to handleTeamsTaskModuleFetch method.
Hi,
I want to know how to pass metadata of adaptive card to
metaData is huge data in my case.
4 Replies
- Dinesh-MSFTFormer Employee
Hi ray2408,
Dialogs with Adaptive Cards work similarly to the HTML or JavaScript case. The major difference is that, because there's no JavaScript when you're using Adaptive Cards, there's no way to call submit(). Instead, Teams takes the
dataobject fromAction.Submitand returns it as the payload of thetask/submitevent.In your adaptive card JSON, include an
Action.Submitaction and place the metadata you want to pass within thedataproperty of the action.In your bot's code, implement thehandleTeamsTaskModuleFetchfunction. This function will be called when the user interacts with the adaptive card. Within thehandleTeamsTaskModuleFetchfunction, you can access the metadata sent from the adaptive card by reading thetaskModuleRequest.dataproperty. Then use the extracted metadata to populate the task module dialog that you want to present to the user.Ref: Use dialogs in Microsoft Teams bots - Teams | Microsoft Learn
- ray2408Brass ContributorIf I place the metadata with the data object, I can pass only limited amount of data. I think it has some throttle point. I have to send a large amount of data which I will be presenting in the form of table in the task module.
How can I achieve this?- Dinesh-MSFTFormer EmployeeSame issue has been tracked here - https://techcommunity.microsoft.com/t5/teams-developer/how-to-use-the-adaptive-metadata/m-p/4111822#M9912. Please follow this thread.
- Dinesh-MSFTFormer EmployeeHi ray2408 - Thanks for raising the query.
We will look into it and let you know the updates.