Site icon Kaizen.Personal computer work.

List(Power Automate Desktop)

Japanese version.

This section introduces List(one-dimensional arrays), which deal with collections of variables.

Tool for Generate

Generate a list/data table with the structure as entered in Excel.

Link

Create

First, the list must be created as a variable.

The procedure differs depending on whether the item (the contents of the list) is a list that does not exist or a list that does exist.

Empty list

To create a list with no items, click on Drag Create new list from Variables onto the Workspace.

Specify a variable name for the List and save it.

An empty list is registered as a variable.

List with items

Drag Set Variable Action from Variables onto the Workspace.

Specify the variable name in Variable and the list in Value.
The Value is enclosed in %, which means formula, and [], which means list.
Then, in [], specify the items separated by ,.
For example, to set 10, 20, and 30, specify %[10,20,30]%.

The following structure is set in the variable list.
The index is a sequential number starting from 0 and is used to manipulate items.

IndexValue
010
120
230

In the previous example, we set a numerical value, but if it is a string, enclose it further with ''.

For example, to set ABC, EFG and HIJ, specify %['ABC','EFG','HIJ']%.

The following structure is stored in the variable list.

IndexValue
0ABC
1EFG
2HIJ

Create text by splitting it with a delimiter character

Use the Split text Action.

Operations on already existing List

Add

To add an item to a list that has already been created
Drag Add item to List Action from Variables onto the Workspace.

Specify the value to be added in Add item and the target list variable in Into list.

New item is added to the end of the list.

Get the count of items

Specify %List.Count%.

For a list with 5 items (indexes 0-4), 5 is the result.

Get item

Specify %List[Index]%.

To get the first value from the list below, use %List[0]%.

IndexValue
010
120
230

If 1 is specified for the Index, the result is 20, and if 2 is specified for the Index, the result is 30.

Get the last item

Specify %List[List.Count-1]% to get the tail.

Delete

There are two ways to do this: by specifying an Index or by specifying a value.

In either case, first drag the Remove item from list Action from Variables onto the Workspace.

For example, delete the index 1 item in the following list.

IndexValue
010
120
230

Deletion results are listed below.

IndexValue
010
130

After deletion, the Index will be packed.

Specify index

Select Index in Remove item by.
Then, specify the index to be deleted in Index and the target list in From list.

Specify value

Select Value in Remobe item by.
Then, specify the value to be deleted in Value and the target list in From list.
If Remove all item occurrences is OFF, the first matching item (lowest number) will be deleted.
When Remove all item occurrences is ON, all matching items will be deleted.

Shuffle list. Randomly reorder items in the list.

Drag Shuffle List Action from the Variables to the Workspace.

Specify a list variable for List to shuffle.

When this action is executed, the order of the items is randomly reordered.

The result will change each time it is executed.

Sort list. Sort items in the list in ascending order.

Drag Sort List Action from Variables onto the Workspace.

Specify a list variable for the List to sort.

Reverse list.Sort list items in descending order

Drag Reverse List Action from Variables onto the Workspace.

Specify a list variable for the List to reverse.

Remove duplicate items from list.

Drag Remove duplicate Items from list Action from Variables to the Workspace.

Specify a list variable for the List to remove duplicate items to from.

If the target list is ['abc', 'efg', 'abc', 'efg', 'ABC'] and
case-sensitive, ['abc', 'efg', 'ABC'], and
If case-insensitive, the result is ['abc', 'efg'].

Converts elements to text by combining them

Use Join Text Action.

Match the two Lists

Find common list items

Extract items common to the two lists.

Drag Find common list items Action from Variables onto the Workspace.

Specify variables for First list and Second list, and Specify the resulting list variable in the Variables produced.
If the resulting list variable does not exist, a new one is created.

If you specify [0, 30, 50, 90] and [10, 20, 30, 40, 50] in the list The common [30, 50] is stored in the variable IntersectionList.

Marge lists

Add a second list to the end of the first list.

Drag Marge lists Action from Variables onto the Workspace.

Specify variables for First list and Second list, and Specify the resulting list variable in the Variables produced.
If the resulting list variable does not exist, a new one is created.

If the listings [0, 30, 50, 90] and [10, 20, 30, 40, 50] are specified, then A second list is added after the first one. [0, 30, 50, 90, 10, 20, 30, 40, 50] will be stored in the variable OutputList.

Subtract lists

Deletes items existing in the second list from the first list.

Drag Subtract lists Action from Variables onto the Workspace.

Specify variables for First list and Second list, and Specify the resulting list variable in the Variables produced.
If the resulting list variable does not exist, a new one is created.

If the listings [0, 30, 50, 90] and [10, 20, 30, 40, 50] are specified, then [0, 90] will be stored in the variable ListDifference.

Clear list

Delete all items on the list.

Drag Clear lists Action from Variables onto the Workspace.

Specify a list variable for the List to clear.

For those who want to learn Power Automate Desktop effectively


The information on this site is now available in an easy-to-read e-book format.

Or Kindle Unlimited (unlimited reading).

You willl discover how to about basic operations.

By the end of this book, you will be equipped with the knowledge you need to use Power Automate Desktop to streamline your workflow.

Links

Power Automate Desktop Introduction.

Examples of Use

Obtain the number, total, average, maximum, and minimum of the numbers in the list.

How to get the deviation.

How to get the least common multiple and greatest common divisor.

How to rank a list of numbers.

How to get the median.

How to get the standard deviation.

How to get the mode.

Automated basic text file operations

Exit mobile version