cancel
Showing results for 
Search instead for 
Did you mean: 

async/await support in code in stage

srinivasvaddepa
Level 2
as per my requirement i need to call c# asynchronous method in code stage 

is BP stage code support Async/await programming ?

------------------------------
srinivas vaddepally
------------------------------
3 REPLIES 3

TobiasArnold
Level 6
Hi srinicas,

Basically you are able to invoke async methods in sync code.

Instead of
var result = await myAsyncFunction();​

Append '.GetAwaiter().GetResult().Output' to your code,

var result = myAsyncFunction().GetAwaiter().GetResult().Output​;


------------------------------
Tobias Arnold
RPA Developer
ITERGO GmbH
Europe/Duesseldorf
------------------------------

Great solution thanks it's worked 


Thanks Arnold,
That solution working super in visual studio. However, if we use in BP code stage it getting stuck.

Here is the best solution I got implemented.

var result = Task.Run(async () => await GetAccessToken()).Result;

 



------------------------------
Mahaboobsubani Shaik
------------------------------