Still working on my stuff for www.nic2012.com

 

I had to flatten some data, send it into a nested runbook

then split it into multi-data values again, forcing Orchestrator to run the next activities multiple times.

 

When selecting how to flatten you have the following options:

image

By default it is set to ,

problem is that when I have to convert it back into multi value data, by using a “run .Net Script” activity,  this separator is OK, but I have to do something like:

$input = "test,test2"
$input -split "," | foreach { $output += ,$_ }
$output

This is because when using “run .Net script” , the output will only become multi-value data, when the output variable is a collection of PowerShell elements.

to define a list of elements we do like this:

$output = “test”,”test2”

we could use other method to create a String array, but orchestrator does not convert a simple value string array into multi-value data.

But I got a great idea!

If I type the separator like:

“,”

image

then the flatten data will end up as

test”,”test2

that’s great!

because in my PowerShell script I can do this:

$output = "<insert published flattened data here>"

this means the runtime script will look like:

$output = "test","test2"

#or if there is only one value in the data

$output = "test"

Perfect! It works!

Orchestrator is outputting multi-value data after the script.

 

Maybe there is a better way, maybe even without powershell, but I have not found it yet!

Please comment if you have any suggestions!