I am trying to execute the following code for all items in a gallery. This code is functional, but it only completes the commands for one item in the gallery.
I seem to be struggling with figuring out how to loop through all items in a gallery and more specifically the syntax required to reference the Participant_ID for each loop.
It seems important to note that the Sum(Filter function is using the Participant_ID from the gallery item to look up the sum of the Amount column where that same Participant_ID exists in the rows of an entirely separate table than what the Gallery is depicting.
I have been at this for a while so any help would be appreciated.
If(
Sum(
Filter(
Profile_Bank,
Participant_ID = ThisItem.Participant_ID
),
Amount
) > 9,
UpdateIf(
'Thumbs Up User Data',
Participant_ID = ThisItem.Participant_ID,
{
Money_Overage: Sum(
Filter(
Profile_Bank,
Participant_ID = ThisItem.Participant_ID
),
Amount
)
};
);
Patch(
'Thumbs Up Bank',
Defaults('Thumbs Up Bank'),
{
Title: "Annual Adjustment",
Participant_ID: ThisItem.Participant_ID,
Customer: LookUp(
'Thumbs Up User Data',
Participant_ID = ThisItem.Participant_ID,
fName
),
Customer_Email: LookUp(
'Thumbs Up User Data',
Participant_ID = varParticipantID,
Email_Column
),
Amount: -1 * Sum(
Filter(
Profile_Bank,
Participant_ID = ThisItem.Participant_ID
),
Amount
),
Date_Created: Text(
Now(),
LongDateTime
)
}
);
ClearCollect(
ThumbsUpUserDataCache,
'Thumbs Up User Data'
);
ClearCollect(
Profile_Bank,
'Thumbs Up Bank'
);
ClearCollect(
ThumbsUpUserDataCache,
'Thumbs Up User Data'
);
ClearCollect(
Profile_Bank,
'Thumbs Up Bank'
);
)