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 / UPDATEIF WITH PROBLEM
Power Apps
Unanswered

UPDATEIF WITH PROBLEM

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi guys,

I'm having a problem in my app, I'm using updateif with checkbox and gallery for make update in data from sql. The table has some dates like data and id. I want to make a update in column direcor = agree from sql. but with updateif work only with some dates.

I trying with patch but it work only with the firts data from database 

ForAll (RenameColumns (Filter (Descarte_Gallery_2.AllItems; Checkbox1.Value = true);
"COD_FILIAL_PRODUTO"; "COD_FILIAL_PRODUTO1";"DATA_EMISSAO";"DATA_EMISSAO1";"TOTAL_DESCARTADA";"TOTAL_DESCARTADA1";"DESC_FILIAL_REDUZ";"DESC_FILIAL_REDUZ1");
UpdateIf('[dbo].[E_DESCARTES]';COD_FILIAL_PRODUTO = COD_FILIAL_PRODUTO1 && DATA_EMISSAO = DATA_EMISSAO1;
{GERENCIA: "APROVADOos"})

 

MY DATE ARE IN TEXT

Categories:
  • WarrenBelz Profile Picture
    156,963 Most Valuable Professional on at

    Hi @Anonymous ,

    Apart from missing a closing bracket the code below should

    • Action all items where in the gallery Descarte_Gallery_2, Checkbox_1 is checked AND for these 
    • Examine your table '[dbo].[E_DESCARTES]' AND
      IF COD_FILIAL_PRODUTO = COD_FILIAL_PRODUTO1 AND 
      DATA_EMISSAO = DATA_EMISSAO1,
      UPDATE the field in your table GERENCIA to the Text "APROVADOos" 

     

    ForAll(
     RenameColumns(
     Filter(
     Descarte_Gallery_2.AllItems; 
     Checkbox1.Value = true
     );
     "COD_FILIAL_PRODUTO"; "COD_FILIAL_PRODUTO1";
     "DATA_EMISSAO";"DATA_EMISSAO1";
     "TOTAL_DESCARTADA";"TOTAL_DESCARTADA1";
     "DESC_FILIAL_REDUZ";"DESC_FILIAL_REDUZ1"
     );
     UpdateIf(
     '[dbo].[E_DESCARTES]';
     COD_FILIAL_PRODUTO = COD_FILIAL_PRODUTO1 && 
     DATA_EMISSAO = DATA_EMISSAO1;
     {GERENCIA: "APROVADOos"}
     )
    )

    You also do not need the rename columns as you do not use them

    "TOTAL_DESCARTADA";"TOTAL_DESCARTADA1";
    "DESC_FILIAL_REDUZ";"DESC_FILIAL_REDUZ1"


    Apart from this, your code is valid and I regularly use the same syntax, so please first look at the filters and see if the issue is there with your data.

     

    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.

  • WarrenBelz Profile Picture
    156,963 Most Valuable Professional on at

    Hi @Anonymous ,

    Just checking if you got the result you were looking for on this thread. Happy to help further if not.

     

    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.

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 221 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 188 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 120

Last 30 days Overall leaderboard