Skip to content

Cannot use loop.index inside a input loop block? #816

Closed
@e-gineer

Description

Version: v0.4.2

I'm trying to do use loop.index inside a loop of an input step, but am getting a parse error.

Code:

  step "input" "approve" {
    notifier = notifier[keys(param.approvers)[0]]

    type = "button"

    subject = param.subject

    prompt = param.prompt

    option "approve" {
      label = "Approve"
      style = "ok"
    }

    option "deny" {
      label = "Deny"
      style = "alert"
    }

    loop {
      until = result.value == "deny" || loop.index >= len(param.approvers)
      notifier = notifier[keys(param.approvers)[loop.index]]
    }

  }

Error:

2024-03-26 07:13:59 [flowpipe] error unable to start server: Internal Error: Failed to decode mod: failed to parse dependency: Bad Request: invalid property path: loop.index
(/Users/nathan/src/flowpipe-mod-approval/mod.fp:10,20-104,2)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions