Skip to content
Discussion options

You must be logged in to vote

this example first filters the data and makes a unique hobby list, based on the hobby, it shows the names

fields:
  - name: data
    type: expression
    value:
    - name: foo
      hobby: ansible
    - name: bar
      hobby: ansible
    - name: ping
      hobby: python
    - name: pong
      hobby: python
      
  - name: hobby # grab hobby and make unique
    type: enum
    runLocal: true
    expression: "[...new Set($(data).map(x=>x.hobby))]"
    default: __auto__
  - name: name # grab name where hobby = $(hobby)
    type: enum
    runLocal: true
    expression: "$(data).filter(x=>x.hobby=='$(hobby)').map(x=>x.name)"
    default: __auto__

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ansibleguy76
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants