cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
daniellerodris
Helper I
Helper I

UpdateIf does not work

Hi!

 

I have an update if function that used to work and now doesn't work anymore. Does anyone know what can it be?

 

 

 

ForAll(Gallery2_3.AllItems;

    UpdateIf(
        ServicoEnviados;
        ID = Value(Title2_89.Text);
        {
            IDEntregaServico: VarIDEntrega;
            StatusVagaAtualizado: "Aguardando Aprovação";
            InformacoesRecrutador: txt_consultoriaEntrega_infoRecrutador.Text;
            DataEntrega: Today();
            DataUltimaAtualizacaoVaga: Today()
        }
    )
);;

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @daniellerodris ,

Try this

ForAll(
   AddColumns(   
      Gallery2_3.AllItems;
      "PID";
      Value(Title2_89.Text)
   ) As aPatch;
   Patch( 
      ServicoEnviados;
      {ID:aPatch.PID);
      {
         IDEntregaServico: VarIDEntrega;
         StatusVagaAtualizado: "Aguardando Aprovação";
         InformacoesRecrutador: aPatch.txt_consultoriaEntrega_infoRecrutador.Text;
         DataEntrega: Today();
         DataUltimaAtualizacaoVaga: Today()
      }
   )
);;

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

5 REPLIES 5
Cooper01
Continued Contributor
Continued Contributor

UpdateIf is not delegable so it may not work depending on how many items are in your list / how many items you bring into in your canvas app. Also I don't know that using UpdateIf on an ID field in a ForAll makes sense since usually IDs are unique. If you want to keep the UpdateIf you may want to consider Patch instead.

Before I used patch and it stopped working too, so I switched to UpdateIf. Do you have any function that substitutes any of these for large data collections?

Cooper01
Continued Contributor
Continued Contributor

I don't know of anything like UpdateIf that works with XL data sets. I don't know of any reason why Patch would not though, I'm imagining something like this. If you're updating a bunch of items at once though you might check out this blog: https://matthewdevaney.com/patch-multiple-records-in-power-apps-10x-faster/

ForAll(
    Gallery2_3.AllItems,
    Patch(
        ServicoEnviados,
        LookUp(
            ServicoEnviados,
            ID = Value(Title2_89.Text)
        ),
        {
            IDEntregaServico: VarIDEntrega;
            StatusVagaAtualizado: "Aguardando Aprovação";
            InformacoesRecrutador: txt_consultoriaEntrega_infoRecrutador.Text;
            DataEntrega: Today();
            DataUltimaAtualizacaoVaga: Today()
        }
    )
)

 

When I use LooKup, I get delegation error for large datasets

WarrenBelz
Super User
Super User

Hi @daniellerodris ,

Try this

ForAll(
   AddColumns(   
      Gallery2_3.AllItems;
      "PID";
      Value(Title2_89.Text)
   ) As aPatch;
   Patch( 
      ServicoEnviados;
      {ID:aPatch.PID);
      {
         IDEntregaServico: VarIDEntrega;
         StatusVagaAtualizado: "Aguardando Aprovação";
         InformacoesRecrutador: aPatch.txt_consultoriaEntrega_infoRecrutador.Text;
         DataEntrega: Today();
         DataUltimaAtualizacaoVaga: Today()
      }
   )
);;

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

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.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

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
Users online (3,154)