Advanced Conditional

Conditionals

Advanced Conditional

Task

Build an object per line item containing the product_id and whether the line item is "oversize". An item is oversize if the unit_of_measure is in this list: CT, PCK, BOX, PL and the quantity is more than 20. "oversize" is a boolean (true/false).

Your Expression
Your Result
No data
Input JSON
{
    line_items:[
      {
        product_id:1,
        unit_of_measure:"EA",
        quantity:10
      },
      {
        product_id:2,
        unit_of_measure:"PCK",
        quantity:50
      },
      {
        product_id:3,
        unit_of_measure:"KGM",
        quantity:5
      },
      {
        product_id:4,
        unit_of_measure:"CT",
        quantity:200
      }
    ]
}
Expected Output
[
    {
      product_id:1,
      oversize:false
    },
    {
      product_id:2,
      oversize:true
    },
    {
      product_id:3,
      oversize:false
    },
    {
      product_id:4,
      oversize:true
    }
]