I have a SharePoint list for expense claims, populated through a form that users enter directly into and which captures line item expenses (with an ID from the SP list ID column) and a claim number, which is generated from within the app on the fly. The claim number is then used in a cascading gallery so that an approver can see a list of claims, and then by selecting an item from the gallery can see the expense line items within it in a second gallery.
When they approve the claim from an approval button, PowerApps uses the patch function to patch in their user ID and date of approval - this works fine; however when a claim has more than one line item only the first expense entry is patched and subsequent ones ignored - I understand why this is as it's only ever seeking the first record found. The problem I am having though is that when I follow other examples to enter a ForAll statement into the patch to collect all matching expense entries under a single claim number, still only the first record is patched.
The data schema:
SP List: 'Staff Expenses'
'Claim Number' is the SP list Title field
Gallery1: The master list of claims
Gallery2: The sub-gallery with expense item details
Patch code without ForAll:
If(
ApproverLevel = "2",
Patch(
'Staff Expenses',
LookUp(
'Staff Expenses',
'Claim Number' = ThisItem.Title
),
{
'Approver 2': User().Email,
'Approval 2 Date': Today()
}
),
ApproverLevel = "3",
Patch(
'Staff Expenses',
LookUp(
'Staff Expenses',
'Claim Number' = ThisItem.Title
),
{
'Approver 3': User().Email,
'Approval 3 Date': Today()
}
),
Patch(
'Staff Expenses',
LookUp(
'Staff Expenses',
'Claim Number' = ThisItem.Title
),
{
'Approver 1': User().Email,
'Approval 1 Date': Today()
}
)
)

How/where do I enter the ForAll function to pick up all expense line items under the same claim number? I'm afraid I can't find the thread I was following before to recount what went wrong. The revised code I tried under both Gallery1 and Gallery2 (same result both times):
If(
ApproverLevel = "2",
ForAll(
Gallery1.AllItems,
Patch(
'Staff Expenses',
LookUp(
'Staff Expenses',
'Claim Number' = ThisItem.Title
),
{
'Approver 2': User().Email,
'Approval 2 Date': Today()
}
)
),
ApproverLevel = "3",
ForAll(
Gallery1.AllItems,
Patch(
'Staff Expenses',
LookUp(
'Staff Expenses',
'Claim Number' = ThisItem.Title
),
{
'Approver 3': User().Email,
'Approval 3 Date': Today()
}
)
),
ForAll(
Gallery1.AllItems,
Patch(
'Staff Expenses',
LookUp(
'Staff Expenses',
'Claim Number' = ThisItem.Title
),
{
'Approver 3': User().Email,
'Approval 3 Date': Today()
}
)
)
)