Sort transform action

Use case

A screenshot of the sort transform action, seen in the actions list menu of the workflow builder canvas.

You are listing users from Microsoft Graph and you would like to sort the result alphabetically based on their displayName attribute.

Overview

Given an iterable, return a new sorted list from the items in the iterable.

Parameters

Parameter
Description
Required

Attribute

When sorting a list of dictionaries, an attribute or key to sort by. Can use dot notation like "address.city".

Case Sensitive

When sorting strings, sort upper and lower case separately.

Input List or String

List or string to sort

Reverse Sort

If true, will sort in descending order instead of the ascending order.

For nested field names, separate them by dots (e.g., details.age).

Usage

Example 1: Sort Users By ID

Inputs:

Attribute: age

Case Sensitive: false

Input List or String:

[
	{
		"id": 6,
		"name": "Dan6",
		"favorite_letter": "a"
	},
	{
		"id": 2,
		"name": "Dan2",
		"favorite_letter": "c"
	},
	{
		"id": 4,
		"name": "Dan4",
		"favorite_letter": "g"
	},
	{
		"id": 1,
		"name": "Dan1",
		"favorite_letter": "B"
	},
	{
		"id": 3,
		"name": "Dan3",
		"favorite_letter": "z"
	},
	{
		"id": 5,
		"name": "Dan5",
		"favorite_letter": "A"
	}
]

Reverse Sort: false

Example 2: Sort A List of Numbers

Inputs:

Attribute: age

Case Sensitive: false

Input List or String:

[83, 42, 36, 30, 15, 54, 68, 30, 29]

Reverse Sort: false

Results output

Results of example 1:

[
  {
    "id": 1,
    "name": "Dan1",
    "favorite_letter": "B"
  },
  {
    "id": 2,
    "name": "Dan2",
    "favorite_letter": "c"
  },
  {
    "id": 3,
    "name": "Dan3",
    "favorite_letter": "z"
  },
  {
    "id": 4,
    "name": "Dan4",
    "favorite_letter": "g"
  },
  {
    "id": 5,
    "name": "Dan5",
    "favorite_letter": "A"
  },
  {
    "id": 6,
    "name": "Dan6",
    "favorite_letter": "a"
  }
]

Results of example 2:

[
  15,
  29,
  30,
  30,
  36,
  42,
  54,
  68,
  83
]

Last updated

Was this helpful?