[From string (line 13) ] @startuml !unquoted function $lookup($id) !$data={"participants":[ {"id": "cm", "label": "label cm", "desc": "desc cm"}, {"id": "tm", "label": "label tm", "desc": "desc tm"}, {"id": "am", "label": "label am", "desc": "desc am"} ]} !foreach $part in $data.participants !if $part.id == $id :id=$part.id \nlabel=$part.label \ndesc=$part.desc; !endif; !endfor !endfunction ^^^^^ This function does not have any !return directive. Declare it as a procedure instead ?