web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / UpdateIf with a large ...
Power Apps
Answered

UpdateIf with a large table

(0) ShareShare
ReportReport
Posted on by 33

Hi everyone,

 

I've a table of 6k data and I would to use UpdateIf, but doesn't work over the 2k.

 

Can you help me?

 

This is an example of my code:

 

 

 

UpdateIf(
 Table;
 And(
 FirstName = "John";
 Value(Year) < 35
 ); 
 { Access: "YES" }
)

 

 

 

Categories:
I have the same question (0)
  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    Hi @DavidePF90,

     

    UpdateIf() is indeed not delegable, meaning it will only look at the first 500 to 2000 records. However if you are using Dataverse as a data source, this may change in the near future (see wave 1 2023 release plan).

     

    A current possible workaround is by using a ForAll() on a filtered data set. In your case this would be:

     

    With(
     {
     source: Filter(
     Table;
     FirstName = "John" && Value(Year) < 35
     )
     };
     ForAll(
     source;
     Patch(
     Table;
     ThisRecord;
     {Access: "YES"}
     )
     )
    )

     

    If this solves your question, would you be so kind as to accept it as a solution.

    Thanks!

  • DavidePF90 Profile Picture
    33 on at

    Thank you so much @LaurensM,

     

    It doesn't work with a large table,

    but I've create a empty hidden gallery with a first filter and i've changed the code:

     

    HiddenGallery.Items:

     

    Filter(
     Table;
     'FirstName = "John"
    )

     

     

    Button.OnSelect:

     

    With(
     {
     source: Filter(
     HidenGallery.AllItems;
     And(
     Value(Year) < 35
     )
     )
     };
     ForAll(
     source;
     Patch(
     Table;
     ThisRecord;
     { Access: "YES" }
     )
     )
    )

     

     

     

     

    Now it works perfectly!!

  • HansHeintz Profile Picture
    704 on at

    Alas, no cigar

    Only 2000 are processed while 

    CountRows(Filter(DierEvent,xDocaNummer>0)) is > 15000

     

     

    With(
     {
     source: Filter(DierEvent,xDocaNummer>0)
     }
     ,ForAll(
     source
     ,With(
     {
     _TxtDocaNum:Text(xDocaNummer,"00000")
     ,_rec:ThisRecord
     }
     ,Patch(
     DierEvent
     ,_rec
     ,{
     Animal:LookUp([@Animals] As AN,AN.'Animal Number'=_TxtDocaNum)
     ,xDocaNummer:0
     } 
     ))
     
     )
    )

     

     

     

  • HansHeintz Profile Picture
    704 on at

    This works:

     

    With(
     {_Reccount:CountIf(DierEvent,xDocaNummer>0)}
     ,ForAll(
     Sequence(RoundUp(_Reccount/2000,0),1)
     ,With(
     {
     source: Filter(DierEvent,xDocaNummer>0)
     }
     ,ForAll(
     source
     ,With(
     {
     _TxtDocaNum:Text(xDocaNummer,"00000")
     ,_rec:ThisRecord
     }
     ,Patch(
     DierEvent
     ,_rec
     ,{
     Animal:LookUp([@Animals] As AN,AN.'Animal Number'=_TxtDocaNum)
     ,xDocaNummer:0
     } 
     ))
     
     )
     )
     )
     )

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard