Perhaps
data.each { |h|
q = h.delete("questionid")
event.set("question#{q}", h)
}
end
would work better for you, and maybe change the event.get to event.remove
Or if you need the array so that you can do the split then move the data using a ruby filter like this one.