# Invoke code activity Error

**URL:** <https://forum.uipath.com/t/invoke-code-activity-error/98031>\
**Category:** Help\
**Tags:** system, activities\
**Created:** [February 26, 2019, 9:23am UTC](https://forum.uipath.com/t/invoke-code-activity-error/98031 "2019-02-26T09:23:38Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Masire](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/masire/32/206547_2.png) [@Masire](https://forum.uipath.com/u/Masire)\
**Post date:** [March 15, 2019, 4:26pm UTC](https://forum.uipath.com/t/invoke-code-activity-error/98031/5 "2019-03-15T16:26:26Z")

</div>

Hello @malam9384,

Hope you’re doing well. I think I had the same problem as yours and this is how I figured it out : using Lambda Expressions (please see example here [VB.NET Lambda Expressions - Dot Net Perls](https://www.dotnetperls.com/lambda-vbnet)).

So, to make your FindMax function in UiPath I followed the following steps:

1. Create the variables in UiPath
2. Add the Invoke code activity in a Sequence and edit arguments to create a “bridge” with previously created variables  
 ![image](https://global.discourse-cdn.com/uipath/original/3X/b/9/b91610d02d21b39e7da63f1f4ead5332ba21ad45.png)
3. Create the Lambda Expression doing the job I want  
 ![image](https://global.discourse-cdn.com/uipath/original/3X/c/7/c71d5c6b5287216b8924776a5ab81e1d84e1e3f5.png)
4. That’s all folks!

You’ll find attached the working XAML file for this example [FindMax With Invoke Code.xaml](https://global.discourse-cdn.com/uipath/original/3X/a/1/a1718b25f08dffc99eb89ef0581ca11dd2f58c81.xaml) (5.7 KB).

Regards,  
@Masire

---

_[View the full topic](https://forum.uipath.com/t/invoke-code-activity-error/98031)._
