System Center Orchestrator 2012: How to convert flattened data into multi-value in a very easy way!

 

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:

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:

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:

this means the runtime script will look like:

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!

By | 2012-01-05T21:57:18+00:00 January 5th, 2012|Automation|3 Comments

About the Author:

Jakob Gottlieb Svendsen

Twitter: @JakobGSvendsen

Jakob Gottlieb Svendsen is a Microsoft Cloud and Data Center Management MVP (http://mvp.microsoft.com/en-us/default.aspx), Working as Global Lead Developer, Senior Consultant and Trainer at CTGlobal, where he is one of the driving forces in keeping CTGlobal a System Center Gold Partner and member of the System Center Alliance.

Since he started at Coretech in 2007, he has focused on Scripting and Development, primarily developing tools, extensions and scripts for the System Center Suite. His main area is Automation (including OMS/Azure Automation, Service Management Automation, PowerShell and Orchestrator). Another area is Windows Azure Pack / Azure Stack, where he does implementation, development, workshops and presentations. He is a world-wide renowned voice in the Automation field.

He is passionately devoted to the community, to which he contributes by being a moderator at TechNet and sharing his knowledge at http://blog.ctglobalservices.com/jgs

  • Co-founder: PowerShell User Group Denmark
  • Speaker at MMS 2016, Minneapolis (www.mmsmoa.com)
  • SCU Europe 2014, 2015, 2016 (www.systemcenteruniverse.ch)
  • Microsoft TechEd North America 2014, Houston
  • NIC 2012,2013,2014,2015, Oslo (www.nic.com)
  • Microsoft CampusDays 2011, 2013, Copenhagen
  • Microsoft TechDays 2015, Sweden (www.techdays.se)
  • Microsoft Partner Event: New in SC2012 SP1
  • User group meetings (PSUG.DK , SCUG.DK/BE/NO, AZMUG + more)
  • Microsoft Certified Trainer.
  • Microsoft Scripting Guys Forum Moderator

Main working areas:

  • Automation (Azure Automation, SMA, SCO)
  • Windows Azure Pack / Azure Stack
  • System CenterVisual Studio Team Services / Team Foundation Server
  • Development:C#.Net, VB.NET, VBScript, PowerShell, Service Manager, OpsMgr, ConfigMgr
  • Orchestrator
  • Windows Azure Pack / Azure Stack

Training:

  • Azure Automation
  • Service Management Automation
  • System Center Orchestrator
  • PowerShell, VBScript, C#.Net, VB.Net
  • Windows Azure Pack / Azure Stack Development Workshops

3 Comments

  1. Chris January 22, 2013 at 13:52 - Reply

    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.

  2. Jakob Gottlieb Svendsen
    Jakob Gottlieb Svendsen January 23, 2013 at 0:22 - Reply

    Hello Chris

    Thanks for posting the other suggestions.

    I have tested this solution in SP1 today, and there is no problems.

  3. Thomas Brevig March 1, 2013 at 9:57 - Reply

    Works great!

Leave A Comment