Reading Array from Orchestrator

Hi,

I have declared array in orchestrator as text type like x,y,z. This array is dynamic. its size may change in future

How can i read the array size in one of the invoke workflow function and loop through it.

Thanks,

1 Like

Usually if you are changing the array size the try to get the value here in the process as a list
Like convert that array variable as list as
List_var = Arrayvariable.ToList()
Where List_var is a variable of type System.Collections.Generic.List(of string) with default value as New list(of string) defined in the variable panel

And to know the count or size of the variable we can use expression like this in assign activity
Int_list_count = List_var.Count
Where int_list_count is a variable of type int32

Cheers @krishbcd

1 Like

Thank you for your quick response.

I have the array from orchestrator in_config(“array”). where array is x,y in orchestrator

How can i pull that to convert as list as said List_var = Arrayvariable.ToList()?

Thanks

1 Like

Hmm…now I have a small doubt buddy
May I know with what type the queue is added in orchestrator
As a string or a array
@krishbcd

text type with , separator. example - x,y,z

  1. once i read the size and the each value, i need to loop
  2. for each, I have to read the respective table values in spreadsheet.

Here x, y and z are table names in spread from which i have to read the values.

Thanks

1 Like

Great
So now we get them as string variable with , between each value
Once after getting queue item and store them in a string variable
Now use a assign activity to convert them as array
arr_values = Split(str_input,”,”)
Where arr_values is a variable of type array of string

Now this can be passed in a loop and obtain the value we want

Cheers @krishbcd

1 Like

Thank you very much for your support and idea. Its working now…

  1. First I have read the orchestrator array as string
  2. Split the string with comma separated and copied to string array.
  3. then for each value in array, I have called my workflow.
1 Like

Great
@krishbcd

1 Like