How to dynamically feed the this.validations_form?

Hi,
I would like to create a form where the form fields are named in the ngOnInit based on data id that arrives in the same ngOnInit:
I would like to use the id in the names of the fields… but no idea how to achieve that?!
Thanks for reading,
V

ngOnInit() {

this.customers = [
{“id”:“1”,“name”:“name1”}
,{“id”:“2”,“name”:“name2”}
,{“id”:“3”,“name”:“name3”}
,{“id”:“4”,“name”:“name4”} ];
this.validations_form = this.formBuilder.group({
amountwater_amt1 : new FormControl(’’,Validators.required)
,amountwater_amt2 : new FormControl(’’,Validators.required)
,amountwater_amt3 : new FormControl(’’,Validators.required)
,amountwater_amt4 : new FormControl(’’,Validators.required)
,amountwine_amt1 : new FormControl(’’,Validators.required)
,amountwine_amt2 : new FormControl(’’,Validators.required)
,amountwine_amt3 : new FormControl(’’,Validators.required)
,amountwine_amt4 : new FormControl(’’,Validators.required)

});

}

interface Customer {
  id: string;
  name: string;
}

customersToFormGroup(fb: FormBuilder, customers: Customer[]): FormGroup {
  let ctrls = {};
  for (let c of customers) {
    for (let liquid of ["water", "wine"]) {
      ctrls[`amount${liquid}_amt${c.id}`] = new FormControl("", Validators.required);
    }
  }
  return fb.group(ctrls);
}

Wowowowow ! :star_struck:

Huge enormous big thanks ! It was exactly what I needed !

Be informed that you put a huge smile on my face right now, thanks !

Have a nice day & thanks a lot !