Getting all arguments of a workflow in a collection


I am looking for a generic way to collect all arguments (in) of a workflow in some type of collection (list would be nice) to display all of their values in a log message. This method should work regardless of the number of arguments, so that I could use it at the begining of each of my workflows. So far, I have been unable to find a method doing this.



Hi buddy @bartierc
In this case we need to mention the DIRECTION of all arguments as IN/OUT
only then we can get the values of each argument that we have defined in each process in the argument panel

  1. After creating the arguments in the argument panel, create a collection list variable in variable panel and name it as out_argument_list of type System.Collections.Generic.List and initiate the variable with a default value like this new list(of string)
  2. And use add to collection activity and mention the list variable name in collection property and the argument name that we have defined all the process with IN/OUT direction, in item property of add to collection and change the type argument as object, as you might have arguments in integer or string or any other type, so lets take it in common with as object
  3. And i would like to tell you that you can display all the values in the list with for each loop activity and passing the list variable as input to the loop and inside using a log message activity to display the values, but we need to make sure that each argument has some default value in it, else only when the arguments gets processed we will be getting the values been displayed in the output panel

Kindly try this and let know buddy and correct me if i have understood the query wrongly
Cheers @bartierc

Thanks for you answer. However, I misunderstand how I can add all the arguments to the collection? I know it should be looped, but I don’t know the loop condition to say “until all arguments have been added to this collection”. I uploaded my workflow so far. (13.2 KB)

1 Like

here you go buddy @bartierc
i declared with list variable itself didn;t use add to collectin
kindly have a look at this
Hope its resolved (12.5 KB)
Cheers @bartierc

did that work buddy @bartierc

Thanks, but this does not solve my issue. Your solution implies that I know the number of arguments, and add all of them indidually to my list (new list (of object) from {argument1,argument2,argument3}). This means that if i have a worfklow with 20 arguments, with names all very different, it will be a pain to make a list with all of those 20 arguments.

What I’m looking for (if it’s even possible), is a way to make a list of ALL arguments, regardless of how many there are and their names.

Usually we are the one going to create the argument in a workflow, so its very obvious that unless we know there wont be any arguments getting generated…so thats why i tried to mention them explicitly in the list as above which would show you the value at the beginning and i have used in mine as well to know the change of value in all arguments from the beginning to the end …Cheers @bartierc