Hi everyone. I am trying to use a patch function to patch 2 different data sources. The first patch works great and is easy since it is creating new records with the code. The second patch needs to update an existing record in a data source.
This is the code I am trying to use, but it only updates 1 record, not all records in the collection. I always struggle with bulk patches like this and I am not confident I am using the lookup function correctly. GameID is a unique field.
ForAll(
colDocketGroup,
Patch(
Game_view_powerapps_No_ICRs,LookUp(colDocketGroup,cr3db_gameid = GameID),
{PMTCompleted:PMTTiming.Text}))
Thanks for the help!
Chris
Solved! Go to Solution.
@ckserra33 could you add the following adjustments as well:
ForAll(
colDocketGroup As Loop,
Patch(
Game_view_powerapps_No_ICRs,
LookUp(Game_view_powerapps_No_ICRs,cr3db_gameid = Loop.GameID),
{PMTCompleted:PMTTiming.Text}))
If this does not work, It might also be worth checking if cr3db_gameid is the correct field name in your Game_view_powerapps_No_ICRs table.
@ckserra33 could you try the code adjustment below:
ForAll(
colDocketGroup,
Patch(
Game_view_powerapps_No_ICRs,
LookUp(Game_view_powerapps_No_ICRs,cr3db_gameid = ThisRecord.GameID),
{PMTCompleted:PMTTiming.Text}))
Explanation:
(1) Your LookUp within the Patch should be the same data source as the one you are patching to in this case.
(2) When you want to refer to a field within the loop data source (your collection), prefix the field with ThisRecord.
Hi @LaurensM , thank you for the quick response. So when I use the code above, it runs without error, but it does not update the data source (Game_view_powerapps_No_ICRs). I have tried it as GameID = ThisRecord.GameID and I have tried it as "cr3db_gameid" = ThisRecord.GameID with the same results. Any idea what I am doing incorrectly?
Thankyou
Chris
@ckserra33 could you add the following adjustments as well:
ForAll(
colDocketGroup As Loop,
Patch(
Game_view_powerapps_No_ICRs,
LookUp(Game_view_powerapps_No_ICRs,cr3db_gameid = Loop.GameID),
{PMTCompleted:PMTTiming.Text}))
If this does not work, It might also be worth checking if cr3db_gameid is the correct field name in your Game_view_powerapps_No_ICRs table.
User | Count |
---|---|
252 | |
112 | |
92 | |
48 | |
38 |