Why should I favor InvokeMethod over VB.NET?

Hee you all,

I have a question related to the Data Manipulation course of UiPath Academy. With practice 1 you have to descend a list and select the first three values. I did this as follows:

newCountries=countries.OrderByDescending(function(countries) countries).ToList.GetRange(0,3)

Which delivered the same result as the answer. However they used the Invoke Method (see picture below). Is there a reason why I should favor the Invoke method over my VB.NET solution?

image

They are introducing you to the various activities you have available in UiPath for data manipulation. There’s also a belief that in a low-code environment like UiPath, using activities is preferred over VB.Net.

To be honest, each have their benefits. The academy solution is visually easier to understand without the need for a strong coding background, whereas the VB.Net is concise and can be read by viewing one activity.

2 Likes