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

Notifications

Announcements

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

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:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,079 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
    153,079 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard