Showing results for 
Search instead for 
Did you mean: 
Not applicable

patching issue requires to push the button twice to update the data in data base

I am facing a problem with patch.
while updating the data in the data base in single click ,it didn't work
But after clicking twice it is updating the database.

Please suggest.....

Frequent Visitor

Hi @Anonymous ,

we need more info to help you, could you please at least send the code of the OnSelect of your button? 

Not applicable

Below is the code for Patch function:


RequestID = varRequestID
ApprovedBy: varUser,
RequestStatus: varAction,
ResponseDate: Now(),
ResponseComments: varComment


In the above code I am trying to update the data in the Request table using Patch
But on the first click this particular column "RequestStatus" is not being pushed and on the second click its getting updated.
So my question is why its is getting pushed on the second click and not on the first click.

Note: The column is getting updated twice after the second click but not changed in the first click.

Thanks in advance...

Frequent Visitor

Where/when is varAction initialized/modified?

Before you click, go to the top left of your screen and click views, then variable.
What is the value of varAction before you click, after you click, and after the second click?

Not applicable

Hi Phydax,

The patch function is running on select of a button which in there on a popup.
To generate that pop up we are clicking on a button and on click of that button we are even passing the value of "varAction".
The value we are passing is "Approved" . I have checked in the "View" and it is passing the value as "Approved" but its not being updated in the database.
where as other values are being updated in the database.


Thanks in advance...

Hi @Anonymous 


Can you try to check if this double click behaviour occurs in a different browser as well? If not, then please clear the cache of the browser and login again. Also, make sure that the browser is in its latest version.

Regarding the field not getting updated, what is the type of field in the datasource and what is the value that you are passing?


Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Frequent Visitor

I'm having a similar issue.... 


[For context, the purpose of this function is checking for duplicate orders within 16 different meta data tables]

I have a gallery that when I select a row, it highlights and does a ClearCollect and a patch on various datatables depending on what row was selected on the gallery.  The ClearCollect works fine and even the patch seems to work fine most of the time.  BUT... There is a duplicate warning label that pops up if the Collection contains any records.  This label shows up properly only about 85% of the time.  But it will show up upon clicking that same gallery row again. 


I know I'm probably being a bit vague here, but the root of it here is that it feels crazy to have code that executes most of the time, but not every single time.  But will work if you click again.

Helpful resources

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.

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.


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,444)