Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Karavan Space - List of suggested variables includes Undefined #1161

Closed
davsclaus opened this issue Mar 4, 2024 · 1 comment
Closed

Karavan Space - List of suggested variables includes Undefined #1161

davsclaus opened this issue Mar 4, 2024 · 1 comment
Assignees
Labels
bug Something isn't working designer Karavan Designer
Milestone

Comments

@davsclaus
Copy link
Contributor

Copy this example yaml into karavan.space, and click the dropdown for list of existing variables. Notice the last says Undefined.

- route:
    id: route-fc08
    from:
      id: from-4fb2
      uri: timer
      parameters:
        period: '5000'
        timerName: beers
      steps:
        - to:
            id: to-2b12
            variableReceive: beer1
            uri: https
            parameters:
              httpUri: random-data-api.com/api/v2/beers
        - to:
            id: to-cd9b
            variableSend: undefined
            variableReceive: beer2
            uri: https
            parameters:
              httpUri: random-data-api.com/api/v2/beers
        - setVariable:
            id: setVariable-439c
            name: alc1
            expression:
              jq:
                id: jq-c893
                expression: .alcohol | rtrimstr("%")
                source: beer1
                resultType: float
        - setVariable:
            id: setVariable-14bc
            name: alc2
            expression:
              jq:
                id: jq-73b5
                expression: .alcohol | rtrimstr("%")
                source: beer2
                resultType: float
        - choice:
            id: choice-3fc5
            when:
              - id: choice
                expression:
                  simple:
                    id: simple-699c
                    expression: ${variable.alc1} > ${variable.alc2}
                steps:
                  - log:
                      id: log-6ecf
                      message: >-
                        Beer battle: ${jq(variable:beer1,.name)}
                        (${variable.alc1}%) is stronger than
                        ${jq(variable:beer2,.name)} (${variable.alc2}%)
            otherwise:
              id: otherwise-03ac
              steps:
                - log:
                    id: log-2477
                    message: >-
                      Beer battle: ${jq(variable:beer1,.name)}
                      (${variable.alc1}%) is weaker than
                      ${jq(variable:beer2,.name)} (${variable.alc2}%)
Screenshot 2024-03-04 at 21 09 29
@mgubaidullin mgubaidullin self-assigned this Mar 5, 2024
@mgubaidullin mgubaidullin added bug Something isn't working designer Karavan Designer labels Mar 5, 2024
@mgubaidullin mgubaidullin added this to the 4.4.1 milestone Mar 5, 2024
@mgubaidullin
Copy link
Contributor

Do not forget to remove variableSend: undefined from your file before try the fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working designer Karavan Designer
Projects
None yet
Development

No branches or pull requests

2 participants