Skip to content

Sort the data stored in a list

In Power Automate Desktop, a variable that can hold multiple values is called a “list”.

This article explains how to sort the data stored in a list.

Copy the following code and paste it into the Power Automate Desktop flow designer to add the actions.

Variables.CreateNewList List=> List
Variables.AddItemToList Item: 3 List: List NewList=> List
Variables.AddItemToList Item: 1 List: List NewList=> List
Variables.AddItemToList Item: 2 List: List NewList=> List
Variables.SortList.SortList List: List SortedList=> List
  1. In “Search actions”, type “Sort list”.
  2. Select the list you want to sort, and the data stored in it is sorted in ascending order.

This action doesn’t throw any errors, so you don’t need to handle any.

Copy the following code and paste it into the Power Automate Desktop flow designer to add the actions.

Variables.CreateNewList List=> List
Variables.AddItemToList Item: 3 List: List NewList=> List
Variables.AddItemToList Item: 1 List: List NewList=> List
Variables.AddItemToList Item: 2 List: List NewList=> List
Variables.ReverseList List: List ReversedList=> List
  1. In “Search actions”, type “Reverse list”.
  2. Select the list whose order you want to reverse, and the order of the data stored in it is reversed.

This action doesn’t throw any errors, so you don’t need to handle any.