Add custom type (JSON) in bpmn modeler and after that write code in expression

We have tried to add custom type as JSON after that we add some code in the expression

var json = S('{"over18":false}'); //
json.prop('over18').isBoolean() //returns true

This expression is working but our json is more complex
We want to know how we can pass whole JSON object in modeler and add the expression so that we can navigate to conditional workflow.

What should we add in custom type pls help !!

Hi team ,
We have done with

this var json = S(data)
var cp = json.jsonPath(“$.name”).stringValue();
cp == 'name of the string to be match ’

The value of the data we passed through api

Next, we just added script expression = javascript