FetchTask: Asynchronous task return?

%3CLINGO-SUB%20id%3D%22lingo-sub-1186343%22%20slang%3D%22en-US%22%3EFetchTask%3A%20Asynchronous%20task%20return%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1186343%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3EI%20have%20a%20Teams%20bot%20with%20composeExtensions.%20When%20user%20selects%20one%20of%20these%20commands%2C%20I%20receive%20an%20event%20in%20my%20bot%20code%3A%26nbsp%3B%20%26nbsp%3Bfunction%26nbsp%3B'handleTeamsMessagingExtensionFetchTask'%3CBR%20%2F%3EThere%20I%20return%20a%20task%20to%20show%20a%20web%20page%20in%20Teams%20browser%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMy%20question%3A%20I%20need%20to%20do%20some%20asynchronous%20code%20before%20returning%20the%20task%2C%20is%20it%20possible%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%2C%3CBR%20%2F%3EDiego%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1186343%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMicrosoft%20Teams%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1190595%22%20slang%3D%22en-US%22%3ERe%3A%20FetchTask%3A%20Asynchronous%20task%20return%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1190595%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F402611%22%20target%3D%22_blank%22%3E%40diegoSpace%3C%2FA%3E%2C%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYes%2C%26nbsp%3B%3CSPAN%3E%26nbsp%3Byou%20can%20perform%20asynchronous%20code%20before%20returning%20the%20task.%20Do%20you%20face%20any%20error%20while%20doing%20so.%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Contributor

Hi,

I have a Teams bot with composeExtensions. When user selects one of these commands, I receive an event in my bot code:   function 'handleTeamsMessagingExtensionFetchTask'
There I return a task to show a web page in Teams browser

 

My question: I need to do some asynchronous code before returning the task, is it possible?

 

Thanks,
Diego

1 Reply
Highlighted

@diegoSpace

Yes,  you can perform asynchronous code before returning the task. Do you face any error while doing so.