Evaluate a Json with an Expression

Hi there!

I’m calling rest service through connector and my payload is like below
{
“loanId”:“FM1001”,
“name”:“Augusto Soncini”,
“loanAmt”:10000000,
“status”:“Review”
}
image

But I dont know how to use the Expression to evaluate the response in a Sequence Flow.
I already try differents options like #{$response.loanId == ‘FM1001’} but seems that is not a valid expression.

Does anybody know how can I evaluate this values without using Java classes?Is it possible?

Thanks in advance!

@Niku you use SPIN JSON:
https://docs.camunda.org/manual/7.8/reference/spin/json/01-reading-json/

In a script output parameter, you can so something like S(response)

That will convert your json into a SPIN json.

Then in expressions when you want to access the json you can do something like
${myJson.prop('status').value()} which would return "Review" based on your example.

See the link above for more details.

1 Like