Difference between revisions of "Constraint: MacroDroid Variable"
| Line 1: | Line 1: | ||
| − | < | + | <pre class="header-style">This constraint allows or prevents a macro/feature from running based on a MacroDroid variable value.</pre> |
| − | + | ''' Options ''' | |
| − | + | * '''Variable''' - Choose the variable to check | |
| + | * '''Boolean''': Match true or false | ||
| + | * '''Integer''': Equals, not equal, greater than, or less than a value (or compare to another variable/expression) | ||
| + | * '''Decimal''': Equals, not equal, greater than, or less than a value (or compare to another variable/expression) | ||
| + | * '''String''': Equals/Not equals, Contains, or Excludes (supports regex and case sensitivity) | ||
| + | * '''Dictionary/Array''': Select a key path, choose the entry type, then apply the same boolean/integer/decimal/string comparison options | ||
| + | |||
| + | ''' Example ''' | ||
| + | |||
| + | ''Example 1: Only launch the camera when a flag is enabled'' | ||
| + | <pre class="trigger-style">Triggers | ||
| + | |||
| + | Widget Button</pre> | ||
| + | <pre class="action-style">Actions | ||
| + | |||
| + | Launch Application: Camera</pre> | ||
| + | <pre class="constraint-style">Constraints | ||
| + | |||
| + | MacroDroid Variable - [camera_allowed] = true</pre> | ||
| + | |||
| + | ''' See Also ''' | ||
| + | |||
| + | * [[Trigger: MacroDroid Variable Change|MacroDroid Variable Change Trigger]] | ||
| + | * [[Action: Set Variable|Set Variable Action]] | ||
Latest revision as of 13:22, 9 January 2026
This constraint allows or prevents a macro/feature from running based on a MacroDroid variable value.
Options
- Variable - Choose the variable to check
- Boolean: Match true or false
- Integer: Equals, not equal, greater than, or less than a value (or compare to another variable/expression)
- Decimal: Equals, not equal, greater than, or less than a value (or compare to another variable/expression)
- String: Equals/Not equals, Contains, or Excludes (supports regex and case sensitivity)
- Dictionary/Array: Select a key path, choose the entry type, then apply the same boolean/integer/decimal/string comparison options
Example
Example 1: Only launch the camera when a flag is enabled
Triggers Widget Button
Actions Launch Application: Camera
Constraints MacroDroid Variable - [camera_allowed] = true
See Also