Originally posted by **EmaLinuxawy** January 17, 2023
Hello Community
I am using YTT to generate multiple pipeline templates, so i want to iterate over data values in an array to get the values based on it's name to the respective job.
i would like to iterate over this job to get an output with 3 build jobs with the name of the job based on each one inside stages array, then iterate over the repo from it's array and just get the value name without the key, and the same thing with the params
```
#@ def build(name, repo, params):
name: #@ name
plan:
- in_parallel:
- get: #@ repo
trigger: true
- task: build
file: path/to/file.yaml
params: #@ params
#@ end
jobs:
#@ for/end stage in [s for s in data.values.build.stages]:
- #@ build()
```
and this is my data/values:
```
build:
stages: ["dev", "stage", "prod"]
repo: ["repo-dev", "repo-stage", "repo-prod"]
params: ["dev", "stage", "prod"]
```
lastly, I have data-values-file with the following:
```
repo-dev: dev-repo-app
repo-stage: dev-stage-app
repo-prod dev-prod-app
dev:
key: value
key2: value2
stage:
key: value
key2: value2
prod:
key: value
key2: value2
```
Discussed in https://github.com/vmware-tanzu/carvel-ytt/discussions/789