Sort fields in ascending and descending order

The example pipeline demonstrates how to sort the data by age and last name from a JSON file in ascending and descending order.


JSON Generator pipeline

Download this pipeline
  1. Configure the JSON Generator Snap with multiple records.

    JSON File in JSON Generator Snap

  2. Configure the Sort Snap to sort the Age in descending order and the Last Name as global. Further, set the Sort order (Global) as ascending.

    Sort Snap Configuration

  3. Validate the Snap. The Sort Snap displays the following output, with Age in descending order and, further, the Last Name in ascending order.

    Sort Snap Output