cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
iskguy
Helper III
Helper III

ForAll not updating? Invalid argument type message

 

 

ForAll(MatchGallery.AllItems,UpdateIf(Customer_Records,ThisRecord.RecordID=RecordID,{'Record Status':"Final"}))

 

 

What is wrong with this statement?  I am getting an invalid type message on the datasource table 'Customer_Records'. All I want to do is go through all items in a gallery and set the Record Status to Final. Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
TheRobRush
Super User
Super User

Here's how it would look syntax wise, (did this on my own gallery so will need to chaneg names)

 

Gallery name is Gallery4, Source is CalendarDates, and column I am editing is named Title

 

 

UpdateIf(CalendarDates, ID in Gallery4.AllItems.ID, {Title:"Final"})

 

_____________________________________________________________________________________
Like my answer? - Hit that Thumbs Up. Resolved the Issue? - Hit Accept as Solution.
This helps others find solutions to future issues!

View solution in original post

3 REPLIES 3
TheRobRush
Super User
Super User

Here's how it would look syntax wise, (did this on my own gallery so will need to chaneg names)

 

Gallery name is Gallery4, Source is CalendarDates, and column I am editing is named Title

 

 

UpdateIf(CalendarDates, ID in Gallery4.AllItems.ID, {Title:"Final"})

 

_____________________________________________________________________________________
Like my answer? - Hit that Thumbs Up. Resolved the Issue? - Hit Accept as Solution.
This helps others find solutions to future issues!
iskguy
Helper III
Helper III

Thanks!

TheRobRush
Super User
Super User

If you end up going over 2k items in that dataset, because then we will need to work on making that formula delegable. UpdateIf only works on smaller Data Sources currently.

 

You can try this in that case

ClearCollect(MatchGalleryCollectionToPatch, MatchGallery.AllItems);
UpdateIf(MatchGalleryCollectionToPatch,true,{'Record Status':"Final"});
Patch(Customer_Records,MatchGalleryCollectionToPatch)

 

sugggested by @AhmedSalih 

_____________________________________________________________________________________
Like my answer? - Hit that Thumbs Up. Resolved the Issue? - Hit Accept as Solution.
This helps others find solutions to future issues!

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (2,212)