CODE MODE: Sort Array of Line Items

  • 24 November 2021
  • 0 replies
  • 15 views

Userlevel 7
Badge +12

CODE MODE: Sort Array of Line Items

 

Tips and Inspiration contributed by: Troy Tessalone | Automation Ace | Zapier Expert | #1 Zapier Community Contributor and Moderator

 

Q: Ever wanted to sort to items in an array?

A: Use a Code app as a Zap step: https://zapier.com/apps/code/help

 

Code step configuration using JavaScript

NOTE: Map your line items array to the right side value for the “Set” Input Data variable in place of “A,B,C,C,B,A”.

 

Sort items in array in ASCENDING order

 

Sort items in array in DESCENDING order

 

RESULTS

Code step results to sort array items in ASCENDING order.

 

Code step results to sort array items in DESCENDING order.

 


0 replies

Be the first to reply!

Reply