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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / I can't update a recor...
Power Apps
Answered

I can't update a record in the sharepoint list

(0) ShareShare
ReportReport
Posted on by 40

Hello! I need to update a record in the sharepoint list, I'm using patch, first and filter, I've tried it with lookup too but nothing works. Can you Help me?

 

ForAll(
Gallery_consultoria.AllItems;
Patch(
ServicoEnviados;
LookUp(
ServicoEnviados;
IDsolicitacao = id_solicitacao.Text);
{
StatusVagaAtualizado: "Em Execução";
PrazoFinalizacao: DatePicker_finalizacao_1.SelectedDate;
DataUltimaAtualizacaoVaga: Now();
Consultor: User().FullName;
EmailConsultor: User().Email
}
)
);;

Categories:
  • Verified answer
    JR-BejeweledOne Profile Picture
    5,836 Moderator on at

    You might try using UpdateIf

     

    ForAll(Gallery_consultoria.AllItems;
     UpdateIf(ServicoEnviados;
     IDsolicitacao = id_solicitacao.Text);
     {
     StatusVagaAtualizado: "Em Execução";
     PrazoFinalizacao: DatePicker_finalizacao_1.SelectedDate;
     DataUltimaAtualizacaoVaga: Now();
     Consultor: User().FullName;
     EmailConsultor: User().Email
     }
     )
    );;
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @daniellerodris 

    Please consider changing your Formula to the following:

    With({_usr: User()};
     Patch(ServicoEnviados;
     ForAll(Gallery_consultoria.AllItems;
     {ID: ID;
     StatusVagaAtualizado: "Em Execução";
     PrazoFinalizacao: DatePicker_finalizacao_1.SelectedDate;
     DataUltimaAtualizacaoVaga: Now();
     Consultor: _usr.FullName;
     EmailConsultor: _usr.Email
     } 
     )
     )
    )

    Your Patch is more related to the record in the Gallery which has an ID in it.  It is that key that can be used to identify the record as opposed to doing a specific lookup on a record as you are.

     

    One other modification is that I moved the expensive User() function out of the Patch statement as this will reduce performance when used within the iterations of the ForAll table function.

     

    I hope this is helpful for you.

  • daniellerodris Profile Picture
    40 on at

    Hello!

     

    If I use the ForAll function inside the Patch function, I return invalid arguments. Expecting a record value instead of a table. Any other suggestions?

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @daniellerodris 

    This means that your ForAll is returning a table that has records with an invalid schema.  The schema returned for the table records should match exactly the schema of your datasource (does not have to have all columns, but has to have the columns supplied to be correct.)

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 243 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 190 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard