Better Invoke Method For One-Liners

Currently the Invoke Method is used in order to use methods on objects, like when a given developer has a List<String> and wishes to use List.Add to append an item to the end. Invoke Method is clumsy however and makes the intent harder to figure out by simply looking at it.

I would ask that a new activity be made that will take a line of code and run it. That way, in the above example, the developer can simply use their List, let’s say “InvoiceNumbers”, and do InvoiceNumbers.Add(Invoice) which is much easier to read and understand.

This is also similar to the Invoke Code activity, but, instead of requiring input and output arguments, it is run within the current scope. The Invoke Code activity, while having this sort of capability, is also unwieldy to use due to the fact that it requires arguments.

Completely agree. It would be much easier to call LINQ methods on Enumerable variables if it did not require adding an invoke code activity and configuring the in/out variable arguments. Currently it seems like the best way to do something like this is via an assign activity, but that requires assigning a value to a variable, which isn’t possible for list methods that return void like Add as you mentioned.


@loginerror @Pablito, Could you please also add this to the internal tracker?

1 Like

Thank you for your suggestion. I added it to our internal ideas tracker for our team to consider.