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:
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:
“,”
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!
I wasn’t able to get this to work in SCOrch SP1; however, here’s something that did: http://social.technet.microsoft.com/Forums/eu/scogeneral/thread/2ac57dba-c29a-4488-af82-8d862f2940bf.
Hello Chris
Thanks for posting the other suggestions.
I have tested this solution in SP1 today, and there is no problems.
Works great!