Creating Custom Conditions Using Twig Templates

In Arigato Automation, a Custom Condition is created using a Twig template that prints out " true" if the condition should pass. You can add a Custom Condition by simply clicking "+ Add Condition" button and searching for "custom condition".

Some examples of what these conditions could look like:

If product title or vendor contains "Shirt":

{% if "Shirt" in product.title or "Shirt" in product.vendor %}
  true
{% endif %}

If product inventory <= 10 or > 100:

{% if product.inventory_quantity <= 10 or product.inventory_quantity > 100 %}
  true
{% endif %}

If product was published in the year 2019:

{{ product.published_at | date("Y") == "2019" ? 'true' : 'false' }}

If product has exactly one tag:

{{ product.tags_array | length == 1 ? 'true' : 'false' }}