Showing results for 
Search instead for 
Did you mean: 
Level: Powered On

Problem with ForAll and Patch

Good Afternoon,


I need a little help.  I've followed the instructions from this document and I'm not getting errors in my code, but there is no data being written to my SP list.

The code below builds a collection when a user enrolls in a particular course.  The collection (colEnrollItems) is a list of records filtered by the users' email address (GvarUserEmail) and the TrainingKey (galCourseDetails.Selected.TrainingKey) which is a specific training course for which they are registered.  There was a bug that introduced duplicates into my dataset and my current patch process was only updating the first record.  I need to update all records that might exist in the dataset for this email and training key combo. 

This code is supposed to compare the source file (Training - Master Output).ID to the "NewID" in the before mentioned collection.  It will update three fields in the source file and loop through all of the records picked up in the collection. 


ClearCollect(colEnrollItems,AddColumns(Filter('Training - Master Output',TrainingKey = galCourseDetails.Selected.TrainingKey,SelfEmail = GvarUserEmail),"NewID",ID));
    Patch('Training - Master Output',
        LookUp('Training - Master Output',ID in colEnrollItems.NewID),
            ScheduleID: ThisItem.ID,
            OfferingChosen: 1,


I am not getting any errors in the code.  The problem is that the patch isn't writing to the SP list at all.  I've tried using both options below and neither of them worked. 


LookUp('Training - Master Output',ID = colEnrollItems.NewID)

LookUp('Training - Master Output',ID = colEnrollItems[@ID])


I'm at a loss, I would love some ideas from the community.  





Helpful resources


Power Apps Super User Class of 2020

Check it out!


New Badges

Check it out!


Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!


Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020


Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (4,811)