Enum field values based on another Enum field #370
Answered
by
ansibleguy76
astlaurent
asked this question in
Q&A
-
|
Hi Trying to figure out how to control one enum field using another. For example |
Beta Was this translation helpful? Give feedback.
Answered by
ansibleguy76
Oct 24, 2025
Replies: 1 comment
-
|
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__ |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
ansibleguy76
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this example first filters the data and makes a unique hobby list, based on the hobby, it shows the names