Allow Loop conditions to use smart values and state variables

XMLWordPrintable

      Currently, the Loop component only evaluates the trigger context in its condition.
      According to the documentation:

      “Loop conditions only evaluate the trigger context and don’t support conditions based on state variables.”

      Because of this:

      • Smart values (e.g. values calculated earlier in the rule)
      • State variables such as loop.count, loop.conditionMet
      • Variables created by the Create variable component

      cannot be used directly in the Loop condition to control whether the loop continues or stops.

      This makes it impossible to configure dynamic loop behaviour based on values that are only known or calculated during rule execution.

      Expected Behaviour

      Allow the Loop condition to evaluate:

      1. Smart values (e.g. {}{{someField{}}}, {}{{createdVariables.*{}}}, values computed by previous actions in the rule)
      1. Loop-related state variables (e.g. {}{{loop.count{}}}, {}{{loop.conditionMet{}}})
      1. Variables from “Create variable” and other state available at that point in the rule

      so that the decision to continue or break the loop can be controlled dynamically, based on values that change during rule execution, not just the initial trigger context.

      Example expectations:

      • Use {{loop.count}} in the condition to stop the loop after a dynamic number of iterations (e.g. a value stored in a custom field or variable).
      • Use a variable from Create variable to determine if the loop should continue (e.g. stop when an accumulated total exceeds a threshold).
      • Use computed smart values (e.g. results from a web request or branching logic) to decide whether the loop should exit early.

            Assignee:
            Unassigned
            Reporter:
            Chung Jeon
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: