cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

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
Solution Supplier
Solution Supplier

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?

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 Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,969)