Show all fetched data to SELECT widget

1
0
-1

Hi, I wanna ask, I wanna use SELECT widget on the bonita form and I want it to have a selection of "fetched data" using GET expression. From the GET expression, my "JSON" turns out need to be JsonSlurped and now I'm stuck for looping the text out. (To show it on SELECT widget, I got an idea to insert the Jsonslurped data to BPM and then fetch it from there)

Here is my code to return JSON data :

<

pre>
import groovy.json.JsonSlurper

def jsonSlurper = new JsonSlurper()
println(bodyAsString)
def body = jsonSlurper.parseText(bodyAsString)

for(int i=0; i<body._embedded.elements.size();i++){

return body._embedded.elements[i].name

}

**output from the script only one of the name that returned.

Perhaps someone can reach me out asap :) Thanks in advance!

No answers yet.
Notifications