As you can see from the subject, I have a VERY complicated flow for a client and I am stumped! I've checked with other IT folks, I've consulted Copilot, and I've made a huge mess of the automation I created. I'm hoping someone can help me, even if that means talking to me like I'm a 5-year-old. Sorry, this gets long!
Here's the summary of what I need it to do for them:
When a new MS Form response is submitted, it looks at the multiple choice answer for "Job Roles," searches in Excel table "Job Roles Ref Sheet" for those job roles in column JobRoleName. For EACH job role, it then looks at the Requirements column for the required trainings for that role. There are multiple trainings in each cell Requirements cell.
After it finds the multiple trainings in the Requirements column for each job role, it then looks at the CAL Onboarding Training Excel table for each of the trainings to get the training details. For instance, the job roles would be submitted as All Staff and Clinician. All Staff requires trainings 2 trainings. Clinician requires 5 trainings.

It then needs to populate a Word template "OnboardingAssignment" table, a repeating section content control, for each onboarding assignment and populate the repeating table with the required training details for each role. So from the previous example there would be one OnboardingAssignments table for "XX-Onboarding - All Staff" with a table reading: Onboarding Assignment Name: XX Onboarding - All Staff, Job Role Assignment: All Staff, Assignment Due Date: (calculate start date plus 90 days), Total Approx. Assignment Duration: (calculate total of LengthMinutes for all courses in the assignment), and then within that repeating section have Course Durations: 20, 20, 15, 75, 20 and Courses in Assignment: CourseName 29, CourseName 30, CourseName 31, CourseName 32, CourseName 33. Then it would have another OnboardingAssignments table for "XX Onboarding - XX Training," "a table for "XX Onboarding - Clinician," "XX Onboarding - OSHA," etc. that fills in the same corresponding information.

The final step is to create a file.
Issues so far:
- MS Form question is multiple choice
- Also multiple items in the Table 1 "Requirements" column that need PowerAutomate to recognize them as individual items
- Power Automate does not recognize a repeating section content control inside a repeating section content control
- The non-repeating table at the top is populating without issue, but the repeating table is putting "body" in the OnboardingAssignmentsTable, leaving out the headings, not filling in the data, and not repeating.
HERE'S WHAT I HAVE:
- When a new response is submitted
- Get response details
- List rows present in a table - Job Role
- Initialize Variable - CombinedRequirements (type = string, value = ) No outputs in successful test.
- Filter Array - Job Role (From: output from List rows present in a table - Job Role, body/value), Filter Query: form question contains item()?['JobRoleName']) No outputs in successful test.
- Select - Job Role (From: body('Filter _Array_-_Job_Role'), Map: Requirements (left) item()?['Requirements']) Outputs appear correct in successful test.
- Compose - CombinedRequirements (Inputs: join(body('Select_-_Job_Role'), '')) Output is identical to input in successful test.
- List rows present in a table - Onboarding Training
- Filter Array - Onboarding Matches (From: output from List rows present in a table - Onboarding Training, body/value), Filter Query: tolower(coalesce(variables('CombinedRequirements'), '')) contains tolower(trim(coalesce(string(item()?['AssignmentName']), '')))) No outputs in successful test.
- Select - Training (From: body('Filter_Array_-_Onboarding_Matches'), Map: see screenshot) No outputs in successful test.
- Populate a Word Template (see screenshot) Outputs (see screenshot)
- Create File (File Content: body of Word template)
If anyone can help me figure out where my flow is broken, causing it to not populate the Word template correctly, I would greatly appreciate it! It runs successfully, it just doesn't run correctly, but apparently nothing returns any outputs!