We are collecting data from three sub-galleries (PS_Tap_Gallery, PS_Flux_Gallery, and PS_SOW_Gallery) inside a parent gallery (PS_Gallery).
Combining it into a collection (col_ProductionUploadPatch), and then patching that data to a SharePoint list (ZEB_Production_Dataset_List).
✅ STEP 1: Loop through each item in PS_Gallery (your main gallery)
ForAll(
PS_Gallery.AllItems,
This loops through each parent record — e.g., a production batch or a job.
✅ STEP 2: Create a local variable parentTitle
With(
{
parentTitle: ThisRecord.Title
},
This keeps the current item's Title handy so you can use it for every sub-item (sub-gallery entry).
✅ STEP 3: Add related sub-gallery entries to the collection
Collect(
col_ProductionUploadPatch,
This uses three nested ForAll loops to go through the sub-galleries and collect structured records:
🟦 a) PS_Tap_Gallery
ForAll(
PS_Tap_Gallery.AllItems,
{
ParentTitle: parentTitle,
SubGalleryType: "PS_Tap_Gallery",
SubItemValue1: ThisRecord.PSTG_Tap_Number_DD.Selected.Value,
SubItemValue2: ThisRecord.PSTG_Tap_Time_Fld.Text,
SubItemValue3: ThisRecord.PSTG_SOW_Count_Fld.Text
}
)
🟦 b) PS_Flux_Gallery
ForAll(
PS_Flux_Gallery.AllItems,
{
ParentTitle: parentTitle,
SubGalleryType: "PS_Flux_Gallery",
SubItemValue1: ThisRecord.PSFG_Flux_Type_DD.Selected.Value,
SubItemValue2: ThisRecord.PSFG_Flux_Weight_Fld.Text
}
)
🟦 c) PS_SOW_Gallery
ForAll(
PS_SOW_Gallery.AllItems,
{
ParentTitle: parentTitle,
SubGalleryType: "PS_SOW_Gallery",
SubItemValue1: ThisRecord.PSSG_SOW_Number_DD.Selected.Value,
SubItemValue2: ThisRecord.PSSG_SOW_Tag_Fld.Text,
SubItemValue3: ThisRecord.PSSG_SOW_Weight_Fld.Text
}
)
➡️ These all add records to col_ProductionUploadPatch, and each record includes:
- ParentTitle
- SubGalleryType
- Up to 3 custom fields: SubItemValue1, SubItemValue2, SubItemValue3
🏷️ Please tag me @MS.Ragavendar if you still have any queries related to the solution or issue persists.
✅ Please click Accept as solution if my post helped you solve your issue and help others who will face the similar issue in future.
❤️ Please consider giving it a Like, If the approach was useful in other ways.