VMware Aria Automation Tools

 View Only
  • 1.  Assembler. Can an input's external source return key-value pairs?

    Posted May 12, 2026 10:05 AM

    In Orchestrator, we have a configuration with variables for Assembler input values. 

    The configuration is called Self-Service Codes. It has variables named after inputs on our self-service form. Variable 'env' is an Array/String with all the values for the 'env' input on the Assembler template. Variable 'sites' is an Array/String with the values for the 'sites' input. And so on. Here's a screenshot:

    We built an action named getSelfServiceCodes. It queries the Self-Service Codes configuration and returns the contents of the desired variable. 

    In Assembler, we set the inputs to have an enumerated list, and the list type to "External Source." The external source is the getSelfServiceCodes action with the appropriate variable. In the screenshot below, the input 'env' calls getSelfServiceCodes with the variable 'env'

    This works great. However, I want to the inputs to be key-value pairs instead of just an array of Strings. In the example above, our users might not understand that d, t, and p correspond to development, test, and production. It's better to set key-value pairs, where the user sees dev, test, and prod while d, t, and p are sent to the workflow. 

    I can select "Keys and values" in the enumerated list type. But that requires me to manually enter the key-value pairs. I want to keep using external source, but return an array of key-value pairs instead of an array of Strings. 

    Is this possible?



    -------------------------------------------


  • 2.  RE: Assembler. Can an input's external source return key-value pairs?

    Posted 30 days ago

    Yes this can be done.
    To do so, you need to change the action you use as external source, it should return an array of Properties.
    Assuming that you already have an array 'environments' the code would be something like

    return environments
    .sort(function(e1, e2) { <sort in the order you want it on screen> })
    .map(function(e) {
    return new Properties({
    value: e.valueReturned,
    label: e.displayName
    description: e.optionalDescription
    }));

    The value corresponds to what you currently  select from a string-array, label is what end-users will see, and description is optional, it will show below the field after a selection was done.

    -------------------------------------------



  • 3.  RE: Assembler. Can an input's external source return key-value pairs?

    Posted 30 days ago

    Outstanding, thanks! 

    I recreated the configuration variables as arrays of Property types rather than arrays of String types. I set the keys for each entry to 'value' and 'label'. 

    Then I rewrote the action to return an array of Property types. Note that, rather than using the map() function, I set the keys in the configuration variables to 'value' and 'label'.

    var configurationElementPath  = "web-root";
    var configurationElementName  = "Self-Service Codes"; //All codes are in the configuration Self-Service Codes.
    var attributeName = variable; //Action has one input, named variable. This is the name of the variable inside the Self-Service Codes variable.
    var category = Server.getConfigurationElementCategoryWithPath(configurationElementPath);
    
    //Locate the variable in Self-Service Codes/variable. Load it into variables.
    for each ( var element in category.configurationElements) { 
        if (element.name == configurationElementName) {
            var configurationElement = element;
        variables = configurationElement.getAttributeWithKey(attributeName).value;
        }
    } 
    
    //Sort the items alphabetically by the value property. Note all items use the same case, so need to adjust case. 
    variables = variables.sort(function(a,b) {
        System.log(a.value);
        if(a.value > b.value){return 1;}
        if(a.value < b.value){return -1;}
        });
    return variables;
    -------------------------------------------