cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
cah2035
Helper III
Helper III

I don't want OnChange action to trigger within half a second of typing into a textbox; trying to Patch datasource with that text

Hi all,

 

In a nutshell, I am attempting to build a gallery with a list of records from a Dataverse (for Teams) table and allow users to edit fields in the gallery to update records, as well as create new records. I am having serious trouble properly updating it, though, and I am not sure what to do.

I actually found this tutorial page for pretty much the exact thing I am trying to accomplish:
https://docs.microsoft.com/en-us/power-apps/maker/canvas-apps/add-editable-tables 

 

This tutorial shows that I should be able to have an editable textbox within a gallery and use the OnChange property to update the data source with the new value of the textbox. They show an animation of this perfectly. However, when I am trying to do this, the OnChange action triggers within typing two characters into the box; I can't just continuously type like they show in the tutorial. So what am I doing wrong, and what is the best solution?

Thanks in advance!

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @cah2035 ,

There is no trigger "OnExit`" available unfortunately. What I have done in some of my apps is disable everything else on the screen at the OnChange of the relevant control, but also make visible an "Update" button (in the same card), which runs the code required and re-enables the other controls. A Variable is used with the button visible and all the other controls disabled when it is true (and the reverse on false). I also include a Cancel icon to reset the control and variable if the change is to be cancelled.

 

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.

Visit my blog Practical Power Apps

 

 

View solution in original post

3 REPLIES 3
WarrenBelz
Super User
Super User

Hi @cah2035 ,

Set the DelayOutput of the Text Box to true - it should not trigger the until you finish typing.

 

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.

Visit my blog Practical Power Apps

Hi @WarrenBelz 

I have tried this but it doesn't really achieve what I want. Since I am using this to update the same source, once it triggers the field loses focus. What I basically need is a trigger that works on exiting the textbox.

My workaround has been to, instead of using OnChange to patch the data source directly, to patch a collection with the record number so later it can cycle through anything that needs to be updated. This is just a very convoluted way of doing it and I worry that there are unforeseen issues that I will run into.

Hi @cah2035 ,

There is no trigger "OnExit`" available unfortunately. What I have done in some of my apps is disable everything else on the screen at the OnChange of the relevant control, but also make visible an "Update" button (in the same card), which runs the code required and re-enables the other controls. A Variable is used with the button visible and all the other controls disabled when it is true (and the reverse on false). I also include a Cancel icon to reset the control and variable if the change is to be cancelled.

 

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.

Visit my blog Practical Power Apps

 

 

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.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

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 (1,352)