Hello!
I'm trying to create a dynamic field that gets converted to a single select list by the code below.
Does anyone know the exact format of the map this code is expecting?
The list needs to be dynamic because it is generated from a continuously changing list from a large SQL table.
I was able to get it working with a rest endpoint but since the sql request is already elsewhere I would like to generate the map at that time.
Thank you!
Here is the code I'm trying to use.
def bPartNum = getFieldById("");
def map = [:]
def result = []
for (int i = 0; i < aItemNo.size() ;i++)
{
result << [value:aItemNo[i], html:aItemNo[i],label:aItemNo[i]]
}
//Response.ok(JsonOutput.toJson(map)).build()
map.put('items', result)
bPartNum.convertToSingleSelect(map)