This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
action:For_Each [2017/03/14 04:57] peternlewis |
action:For_Each [2021/10/12 23:21] peternlewis |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | {{:action:for-each-icon.png?nolink |}} | ||
====== For Each Action ====== | ====== For Each Action ====== | ||
- | The For Each action loops over a set of [collections](:Collections) of items, setting a variable to each value and executing the contained actions. | + | The *For Each* action loops over a set of [collections](:Collections) of items, setting a variable to each value and executing the contained actions.\\ |
+ | It is one of several Actions that _loop_ through a set of other Actions until some criteria is met. | ||
+ | |||
+ | **Looping Actions** | ||
+ | |||
+ | * [[action:For_Each|For Each]] action | ||
+ | * [[action:Repeat|Repeat]] action | ||
+ | * [[action:Until|Until]] action | ||
+ | * [[action:While|While]] action | ||
Whenever you need to deal with a list of things (lines, files, volumes, numbers, etc), the For Each action is a good place to start. | Whenever you need to deal with a list of things (lines, files, volumes, numbers, etc), the For Each action is a good place to start. | ||
===== How To Use ===== | ===== How To Use ===== | ||
+ | |||
- Add the //For Each// Action, from the //Control Flow// Category, to your macro | - Add the //For Each// Action, from the //Control Flow// Category, to your macro | ||
- {{:action:km-editor-for-each-action.png?nolink|}} | - {{:action:km-editor-for-each-action.png?nolink|}} | ||
Line 19: | Line 28: | ||
- Drag one or more actions into the //No Action// (which means no actions have been added yet) area. | - Drag one or more actions into the //No Action// (which means no actions have been added yet) area. | ||
* These actions will operate on each item in the Collection that is stored in the Variable from Step #2 | * These actions will operate on each item in the Collection that is stored in the Variable from Step #2 | ||
+ | |||
+ | You can break out of the loop, retry this iteration, or skip to the next iteration with the [[actions:Redirect_Control_Flow|actions:Redirect Control Flow]] actions. | ||
===== Examples ===== | ===== Examples ===== | ||
Line 34: | Line 45: | ||
===== See also ===== | ===== See also ===== | ||
- | |||
- | ---- | ||
=== Actions === | === Actions === | ||
- | * [[action:Search Variable|action:Search Variable]] | + | * [[action:For_Each|For Each]] action |
+ | * [[action:Repeat|Repeat]] action | ||
+ | * [[action:Until|Until]] action | ||
+ | * [[action:While|While]] action | ||
+ | * [[action:Assert|Assert]] action | ||
* [[:Actions|See all actions]] | * [[:Actions|See all actions]] | ||
Line 47: | Line 60: | ||
* [[:Triggers|See all triggers]] | * [[:Triggers|See all triggers]] | ||
- | ---- | ||
==== Forum ==== | ==== Forum ==== |