Best answer

Sorting a list of results

  • 9 April 2020
  • 1 reply
  • 230 views

Userlevel 7
Badge +9

Long story short I have a list in storage of items that I need sorted. It starts with a date field and so all I need is numeric sorting from smallest to largest. 

 

I’m going to look for a code step to make this happen, but I just wondered if there was any one out there with a solution inside Zapier that I’m not thinking of. I can make these line items, they’re currently list items in a Storage by Zapier List. Here’s a sample of my current output from a List in Storage:

 

4/8/2020,9:00 AM,1:00 PM,Inga

4/9/2020,9:00 AM,1:00 PM,Vanessa

4/7/2020,9:00 AM,1:00 PM,Vanessa

4/10/2020,9:00 AM,1:00 PM,Inga

4/3/2020,9:00 AM,1:00 PM,Quad

4/1/2020,9:00 AM,1:00 PM,Quad

3/31/2020,9:00 AM,1:00 PM,Inga

4/2/2020,9:00 AM,1:00 PM,Vanessa

icon

Best answer by PaulKortman 10 April 2020, 00:10

I solved it with a single line of code, but I’d love to do this without code… here’s my code if this is the only way:

 

output = [{original: inputData.list, sorted: inputData.list.split("\n").sort()}];

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

1 reply

Userlevel 7
Badge +9

I solved it with a single line of code, but I’d love to do this without code… here’s my code if this is the only way:

 

output = [{original: inputData.list, sorted: inputData.list.split("\n").sort()}];