Skip to main content
Question

How to check length of array and Apply Greater or Less Condition on that array In Pipeline

  • July 16, 2020
  • 0 replies
  • 173 views

Hi,
I have a JSON response in which I have JSON array. I want to apply a condition like if length of array is greater then 0 then do some operation else do some other operation in pipeline. JSON Sample like

 
Abhishek


------------------------------
Abhishek Kumar
------------------------------
This topic has been closed for replies.

The expression language is Jinja, Jinja2 to be more specific...

if you're able to drill down in the pipeline steps to reference the JSONArray, then you should be able to do:

{{ a.JSONArray | length }}

This isassuming the call is in the a step of the pipeline.

------------------------------
Ryan Stanford
------------------------------