The Conditional Utility allows you to set conditions to tell your workflow which path to follow, depending on which condition is matched by the argument.
Using the Conditional Utility
Think of the conditions as a set of possible paths your
The matching conditions are:
- is equal to
- is not equal to
- is greater than
- is less than
- matches regex
The first four matches are simple and self-explanatory, and can be set to match exactly or ignore whether the argument uses upper/lowercase for more precision.
If you want to match "is greater or equal to", you can simply add two condition rows, then connect their output to the same next object.
Using Regex for Condition Matching
If your needs are more advanced, you can also use regular expressions (regex) to match the input. Alfred conforms to ICU v3. A useful site to create and check your regular expressions is http://regexr.com.
Workflow Example using the Conditional Utility
This built-in workflow uses the Conditional utility to decide whether to follow the blue path at the top, or the purple path at the bottom; The top path adds your new task to your to-do list, while the bottom one opens the relevant to-do list file for you to view.
You can find this example built into Alfred by going to the Workflows tab, clicking the [+] at the bottom of the sidebar and choosing Examples > Simple To-Do List.