cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
nish5562
Frequent Visitor

Collection use in ForAll for data stored from filtered gallery

I have a gallery in which i am filtering the data and then storing the data in a collection:

ClearCollect(theEmplyNameToStore,Gallery4.AllItems.emailID); 

 

After storing the filtered items in collection them i am storing data in SharePoint list :

ForAll(theEmplyNameToStore,(Patch( assigCourseVic, Defaults( assigCourseVic ), { Title:enteredCourseName_2.Text,engEmailID:theEmplyNameToStore.emailID,startDate:startDateApp_2.SelectedDate,endDate:endDateApp_3.SelectedDate,courseStatus:courseStatusChoice_1.Selected,comments:commentLinkGroup_1.Text,mangersNameSelected:managersName.Selected.Result} ));

 

But i am not able to use the collection as it giving an error saying expecting text for engEmailID but provided table.

 

Thanks 

1 REPLY 1
BCLS776
Super User
Super User

ForAll statements often need some help with scope. Try this:

ForAll(theEmplyNameToStore As aRecord,
    Patch(assigCourseVic, Defaults(assigCourseVic), 
        {    
        Title: enteredCourseName_2.Text, 
        engEmailID: aRecord.emailID, 
        startDate: startDateApp_2.SelectedDate, 
        endDate: endDateApp_3.SelectedDate, 
        courseStatus: courseStatusChoice_1.Selected, 
        comments: commentLinkGroup_1.Text, 
        mangersNameSelected: managersName.Selected.Result
        } 
    )
);

Hope that helps,

Bryan

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

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