web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Trying to patch a nest...
Power Apps
Answered

Trying to patch a nested gallery as an Edit page and having issues getting the patch to work with the ForAll

(0) ShareShare
ReportReport
Posted on by 241

This is an edit page to linked records from two lists.  

 

gallery1 list patches correctly

gallery2 is the items gallery with multiple items involved and will not patch

 

Here is the update button for the second gallery.  I am trying to match the IDs from the list:

ForAll(colEditItems,
Patch('CP-ITEMS', LookUp('CP-ITEMS', ID = ID,
{
itemName: tiEditRequestsItemName.Text,
itemDesc: tiEditRequestsItemDesc.Text,
LUvendorName: {Id: LookUp('CP-VENDORS', vendorName = cbbEditRequestsItemVendor.Selected.vendorName).ID,
Value: cbbEditRequestsItemVendor.Selected.vendorName},
qty: Value(tiEditRequestQty.Text),
LUuom: {Id:LookUp('CP-UOM', unitOfMeasure = cbbEditRequestsItemUom.Selected.vendorName).ID,
Value: cbbEditRequestsItemUom.Selected.vendorName},
pricePerUom: Value(tiEditRequestPricePer.Text),
itemUrl: tiEditRequestItemUrl.Text,
itemNotes: tiEditRequestsItemNotes.Text,
itemNetAmount: Value(lblCPREditItemAmount.Text)
}
)
)
);

Categories:
  • WarrenBelz Profile Picture
    156,545 Most Valuable Professional on at

    Hi @scottmcnitt ,

    What is the Items property of both the main and nested galleries (how are they linked ?)

  • scottmcnitt Profile Picture
    241 on at

    Main:

    Items > galRequestsMain.Selected

     

    Nested: 

    Items > Filter('CP-ITEMS', LUmID.Value = galRequestsMain.Selected.ID)

     

    They are linked with LUmID on the Items List which is the same value as the ID from Master.  

     

  • scottmcnitt Profile Picture
    241 on at

    Right now OnVisible properties of the screen we are collecting the IDs

    ClearCollect(colEditItems, Filter('CP-ITEMS', LUmID.Value = Text(galRequestsMain.Selected.ID)))

     

    and the Update button is as follows:

    Patch(
    'CP-MASTER',
    LookUp('CP-MASTER', ID = Value(lblEditRequestID.Text)),
    {
    LUreceivingDepartment: cbbEditRequestsReceivingDept.Selected,
    LUdeliveryAddress: cbbEditRequestsDeliveryAddress.Selected,
    wbs: tiEditRequestsWbs.Text,
    LUstatuses: {
    Id: 2,
    Value: "SUBMITTED FOR APPROVAL"
    },
    notes: tiEditRequestsNotes.Text,
    netAmount: Value(lblCPREditNetAmount.Text)
    }
    )
    ;

    ForAll(colEditItems,
    Patch('CP-ITEMS', LookUp('CP-ITEMS', ID = ID,
    {
    itemName: tiEditRequestsItemName.Text,
    itemDesc: tiEditRequestsItemDesc.Text,
    LUvendorName: {Id: LookUp('CP-VENDORS', vendorName = cbbEditRequestsItemVendor.Selected.vendorName).ID,
    Value: cbbEditRequestsItemVendor.Selected.vendorName},
    qty: Value(tiEditRequestQty.Text),
    LUuom: {Id:LookUp('CP-UOM', unitOfMeasure = cbbEditRequestsItemUom.Selected.vendorName).ID,
    Value: cbbEditRequestsItemUom.Selected.vendorName},
    pricePerUom: Value(tiEditRequestPricePer.Text),
    itemUrl: tiEditRequestItemUrl.Text,
    itemNotes: tiEditRequestsItemNotes.Text,
    itemNetAmount: Value(lblCPREditItemAmount.Text)
    }
    )
    )
    );

  • Verified answer
    WarrenBelz Profile Picture
    156,545 Most Valuable Professional on at

    @scottmcnitt ,

    You posted this was a nested gallery, so should the Items of the second one be

    Filter(
     'CP-ITEMS', 
     LUmID.Value = ThisItem.ID
    )

    as this would then have a sub-gallery on each item or is this a separate sub-gallery with a one-to-one relationship with the main gallery ? 

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 405 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 368

#3
WarrenBelz Profile Picture

WarrenBelz 244 Most Valuable Professional

Last 30 days Overall leaderboard