Nested objects and arrays

Each company has a Manager object and an Employees array. Their keys are looked up inside the element their own key matched, so each FirstName lands in the right place, and the employees repeat inside each company's copy.

Result

Template

Script