Hey @HowardRanyard
From reading in to this it looks like you want nested repeaters as you mention. I’ve been able to quickly produce the following which is a hierarchy of:
- Asset Head
- Inspection (linked by Tasks attribute)
- Files (linked by Attachments attribute)
You will need 4 data sources to achieve this:
1. Asset (single item datasource)
This will be the asset you want to load the inspections for and associated files of those inspections.
I tagged this with IncomingItemId
so it would automatically pickup the item (the Asset) and use it for this datasource.
2. Inspections (AQS datasource)
This will be all inspections for the asset above. You can do this through an aqs query that looks like:
{
"type": "Join",
"properties": {
"attributes": [
"attributes_inspectionsInspectionNumber",
"attributes_itemsTitle",
"attributes_itemsSubtitle",
"attributes_filesAttachableAttachments"
],
"collectionCode": "Live",
"dodiCode": "designInterfaces_inspections",
"joinAttributes": [
"root.attributes_tasksStatus.attributes_taskStatusesStatus"
],
"parameters": [
{
"name": "attributes_asset_64b7b215506d407359dffd21.itemId",
"type": "AlloyId",
"title": "Asset Item Id"
}
]
},
"children": [
{
"type": "Equals",
"children": [
{
"type": "ItemProperty",
"properties": {
"itemPropertyName": "itemId",
"path": "root^attributes_tasksAssignableTasks<designInterfaces_assetHeads>"
}
},
{
"type": "AlloyId",
"properties": {
"parameterName": "attributes_asset_64b7b215506d407359dffd21.itemId"
}
}
]
}
]
}
You will have to apply this to your situation but the idea is: “Get all inspections where the parent asset (by tasks attribute) is equal to the item id from the first datasource”. The AQS Parameters help with this by allowing you to get the item id of the first datasource.
3. Files (AQS datasource)
Now we want all the attachments (Files) that are associated to the inspections via the “Attachments” attribute. Similar to the above we use the AQS parameters to take the inspections found in the above datasource and find all their attachments, the AQS looks like:
{
"type": "Query",
"properties": {
"collectionCode": "Live",
"dodiCode": "designs_files",
"parameters": [
{
"name": "attributes_inspectionsForAsset_64b7b2b7506d407359dffecc.itemId",
"type": "AlloyId",
"title": "Item Id"
}
]
},
"children": [
{
"type": "Equals",
"children": [
{
"type": "ItemProperty",
"properties": {
"itemPropertyName": "itemId",
"path": "root^attributes_filesAttachableAttachments<designInterfaces_inspections>"
}
},
{
"type": "AlloyId",
"properties": {
"parameterName": "attributes_inspectionsForAsset_64b7b2b7506d407359dffecc.itemId"
}
}
]
}
]
}
4. Join Inspections to Files (Join Datasource)
Now you want to join inspections onto files using the report builder join datasource. This will produce the datasource you want to use in the repeater with all headers from both in one table.
Putting it all together
Finally you want to produce a flow document that resembles the following:
[table datasource=assets]
[repeater datasource=join_ds repeat_on=itemid_of_inspection]
[horizontal_stack datasource=parent_repeater_context]
[vertical_stack datasource=parent_repeater_context]
[field label=title value=parent_repeater_context.title_of_inspection]
... other fields here ...
[/vertical_stack]
[repeater datasource=parent_repeater_context repeat_on=itemid_of_file]
[file_image datasource=parent_repeater_context item=itemid_of_file]
[/repeater]
[/horizontal]
[/repeater]
And you should see something similar to the image above (I’ve added some margins etc.)
If you are having trouble configuring this then please reach out to our support team who can help