Add string to List of Strings using Invoke method

Hi Guys,
I came across this and I was wondering if there is a better way for adding multiple strings to a list without using a for each loop.

So before sharing the XAML file for the solution let just explain once again how the activity invoke method works.

What you need to do for it to work is three things:

  1. Write the variable name that you want to perform the method on in the “TargetObject” property.
  2. Write the method name in the “MethodName” property.
  3. In properties panel in the parameters add collection that should contain the arguments that the method should work with (you must make sure how much and what type of arguments your method accepts, if two arguments then each one of them must be on a specific line)

For this specific case you need to use AddRange with a single argument of the type IEnumerable<String> where its value should look like this {“Str1”,“Str2”,…}

Finally here is a XAML file illustrating all I said: InvokeMethodAddStrings.xaml (8.0 KB)

Regards,
Reda

5 Likes