Discussions

Expand all | Collapse all

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

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

    Posted 22 days ago
    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
    ------------------------------


  • 2.  RE: How to check length of array and Apply Greater or Less Condition on that array In Pipeline

    Posted 22 days ago
    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
    ------------------------------