How to Set Value Labels in Drop-Down in Header Logic

There's a method Object option(String entryName, List<Object> options, Map<String,Object> labels) which allows you to set values' labels in the drop-down. To set these labels when adding the drop-down in a quote header logic, use the following examples.

This is a header-level drop-down with simple options (just the list of values):

def endCustomerList = [
	"customer1",
	"customer2",
	"customer3"
]

quoteProcessor.addOrUpdateInput("ROOT", [
	"name" 			: "endCustomer",
	"label" 		: "End Customer",
	"type" 			: InputType.OPTION,
	"valueOptions" 	: endCustomerList,
])


If you want to add labels, you need to assign a map with key "labels" to a field "parameterConfig". The "labels" will contain your map with key-value pairs, where key is the name of the option and value is the label.

def mapWithLabels = [ 
	"customer1" : "First Customer",
	"customer2" : "Second Customer",
	"customer3" : "Third Customer"
]

quoteProcessor.addOrUpdateInput("ROOT", [
	"name" 				: "endCustomer",
	"label" 			: "End Customer",
	"type" 				: InputType.OPTION,
	"valueOptions" 		: endCustomerList,
	"parameterConfig"	: [
		"labels": mapWithLabels
	]
])

Found an issue in documentation? Write to us.