Skip to main content

Notifications

Community site session details

Community site session details

Session Id : /aAOKidVtYdMeho7Xk8Wcf
Power Apps - Building Power Apps
Answered

UpdateIf with a large table

Like (0) ShareShare
ReportReport
Posted on 1 Feb 2023 14:39:51 by 31

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" }
)

 

 

 

  • HansHeintz Profile Picture
    674 on 23 Jun 2024 at 08:26:15
    Re: UpdateIf with a large table

    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
     } 
     ))
     
     )
     )
     )
     )
  • HansHeintz Profile Picture
    674 on 23 Jun 2024 at 07:52:46
    Re: UpdateIf with a large table

    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
     } 
     ))
     
     )
    )

     

     

     

  • DavidePF90 Profile Picture
    31 on 02 Feb 2023 at 07:45:53
    Re: UpdateIf with a large table

    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!!

  • Verified answer
    LaurensM Profile Picture
    12,510 Super User 2025 Season 1 on 01 Feb 2023 at 17:14:37
    Re: UpdateIf with a large table

    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!

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,658 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,999 Most Valuable Professional

Leaderboard
Loading started