Groovy web console

subscribe to the feed Subscribe
to this
site

Dynamic node creation

Published 1 month ago by Rutger
Actions Execute script  ▶ Edit in console Back to console Show/hide line numbers View recent scripts
import groovy.json.JsonBuilder

def nodeKey = 'lastName'
def nodeValue = 'Doe'

map = [:]
map.put(nodeKey, nodeValue)

string = new JsonBuilder(map)