Changes

no edit summary
Line 1: Line 1: −
<span style="color: #0E9549; font-size: 24px;">'''About this constraint '''</span>
+
<pre class="header-style">This constraint allows or prevents a macro/feature from running based on a comparison between two values or variables.</pre>
   −
This constraint can be used to allow/prevent functionality depending on the comparison of two values.
+
''' Options '''
   −
It provides a convenient shortcut to allow comparison of magic text values, variable values and constants without the need to store values in temporary variables.
+
* '''Compare Type''' - Indicates what type of comparison to perform from boolean, integer, decimal, string, array or dictionary.
 +
* '''Value1''' - The first value to compare
 +
* '''Value2''' - The second value to compare
 +
* '''Operator''' - Depends on the type of comparison (for example for string you can check if value1 contains value2, for integers you can compare if value1 is greater than value2)
 +
 
 +
''' Example '''
 +
 
 +
''Example 1: Enable mobile data only when a usage flag is set''
 +
  <pre class="trigger-style">Triggers
 +
 
 +
Screen On/Off - Screen On</pre>
 +
  <pre class="action-style">Actions
 +
 
 +
Mobile Data On/Off (Enable)</pre>
 +
  <pre class="constraint-style">Constraints
 +
 
 +
Compare Values - [data_allowed] = 1</pre>
 +
 
 +
''' See Also '''
 +
 
 +
* [[Action: Set Variable|Set Variable Action]]
 +
* [[Constraint: MacroDroid Variable|MacroDroid Variable Constraint]]