Orchestrator Function: Convert a Properties Object to an Array of Properties

by Simon Sparks · 1 November 2025

To use this function add it to the class library file named Utilities.ts

GitHub Repository: https://github.com/SimonSparksUK/Orchestrator

Filename: Utilities.ts

Description: Orchestrator Function to Convert a Properties Object to an Array of Properties

Function ConvertPropertiesToArrayOfProperties

publicstaticConvertPropertiesToArrayOfProperties(objPropertiesInput:Properties):Properties[]{

letarrPropertiesOutput:Properties[]= [];

letarrKey:string[]=objPropertiesInput.keys;

arrKey.forEach((strKey:string):void=>{

letstrValue:string=objPropertiesInput.get(strKey);

letobjPropertiesOutput:Properties=newProperties()
objPropertiesOutput.put("value",strKey);
objPropertiesOutput.put("label",strValue);

arrPropertiesOutput.push(objPropertiesOutput);

});

returnarrPropertiesOutput;
}

Discover more from Cloud Build Tools

Subscribe to get the latest posts sent to your email.

You may also like