My word template is for an Inspection Report that has some basic data about the inspection. I am able to populate the basic data in a report without issue using the Populate Word Document action. I'm having issues with a repeating table that could be included in the report.
Each report can have zero or more "Modifications". Each "modification" has some basic data (location, modification type, etc) and can also have zero or more photos, each with a caption. So I set up a <<foreach>> loop to handle Modifications and then a nested <<foreach>> loop to handle photos associated with each modification. However, none of the modification data or photo data is appearing in my word documents.
Below is the JSON data that gets sent to the Word Template. Within the flow, the data below is added to a "Compose" action and the output is then added as the "Document Data" input in the Populate Word Document Action. The photos are in "base64" and are extremely long so I cut some of the text out. Maybe this is an issue that I need to handle. I'm new to this whole thing so using base64 images and how best to work with them is also something I'm not familiar with.
{
"ProjectID": "12-23456",
"SiteName": "Pink House",
"Location": "3424 N Oklahoma Ave, Oconomowoc, WI 54567",
"SiteID": "12345677",
"Permittee": "Paul Satterlee",
"County": "Waukesha",
"PhaseDesc": "Middle",
"ContractorName": "Nathan Walker",
"Contractor": "WiseGuys construction",
"PhoneNo": "920-366-8080",
"InspectorName": "Satterlee, Paul",
"InspectionDate": "2/21/2025",
"InspectionStartTime": "01:02 AM",
"InspectionEndTime": "01:45 AM",
"WeeklyInspection": "no",
"PrecipitationInspection": "yes",
"Other": "none",
"Weather": "Cloudy",
"RainfallDate": "2/21/2025",
"RainfallTotal": "2",
"ReportDate": "2/21/2025 10:07 AM",
"Modifications": [
{
"ID": 6,
"Location": "Around north lot line ",
"Erosion_Condition": "sediment overflow",
"Maintenance_Description": "This is the maintenance necessary for the turbidity barrier",
"Modification_Type": "Turbidity Barrier",
"Photos": [
{
"imageBase64": "aVZCT1J3MEtHZ29BQUFBTlNVaEVVZ0FBQWE4QUFB",
"caption": "last photo sucked, adding another photo to this modification"
}
]
},
{
"ID": 9,
"Location": "Around south and west lot line",
"Erosion_Condition": "Sediment flowing over silt fence",
"Maintenance_Description": "Exisiting silt screen should be removed and then reinstaled",
"Modification_Type": "Silt Screen",
"Photos": [
{
"imageBase64": "aVZCT1J3MEtHZ29BQUFBTlNVaEVVZ0FBQWE4QUFBT",
"caption": "last photo sucked, adding another photo to this modification"
},
{
"imageBase64": "aVZCT1J3MEtHZ29BQUFBTlNVaEVVZ0FBQ",
"caption": "This image is added as an attachment and not as a datastream. Supposedly this will work better "
},
{
"imageBase64": "aVZCT1J3MEtHZ29BQUFBTlNVaE",
"caption": "This is a second attachment"
}
]
}
]
}
Below is a screenshot of the Word Template as I have it currently set up. I tried to follow the "Repeating Tables" blog article and any documentation I can find. Ideally, within each "Modification Details" table, the photo section repeats as many times as necessary. Then, if there's more Modifications, the whole Modifications table repeats again (as many times as necessary).

Any advice, thoughts, or suggestions are very much welcome. I've been struggling with this all week and I'd love to get it figured out. Thanks in advance!