cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Pegger
Helper I
Helper I

Patches incomplete when buttons clicked too quickly

I have two radio buttons in my app.  Each button has 2 patch statements within the OnChange property.  One patch statement updates the radio button selection's value into a Choice field in a SharePoint List.  Another patches a calculated text label value associated with that radio button selection to a 2nd field in the SharePoint list.

 

I have noticed that at times, when selecting the radio buttons too quickly, the patches will not complete properly.  For example, the 2nd patch in one of the button's OnChange property won't push the updated calculated text label value to the SharePoint List.  I believe this is happening because PowerApps is still processing the first selection when the 2nd one is being made.

 

Is there a way to ensure the statements in a particular action get completed and not interrupted?  Can PowerApps queue the statements to ensure they don't get lost?

1 ACCEPTED SOLUTION

Accepted Solutions
v-xiaochen-msft
Community Support
Community Support

Hi @Pegger ,

 

After you press the first button, it takes a while to execute the formula.

If the second button is pressed during the execution of the formula, the result will indeed be wrong.

 

So, I suggest you modify the display mode property of the second button.

You could try to set a variable.

Set(A,DisplayMode.View)

Then, You could modify the value of the variable at the first button.

Set(A,DisplayMode.Edit)

 

Before the formula of the first button is executed, the second button cannot be clicked.

 

Best Regards,

Wearsky

If my post helps, then please consider Accept it as the solution to help others. Thanks.

View solution in original post

4 REPLIES 4
v-xiaochen-msft
Community Support
Community Support

Hi @Pegger ,

 

You could try to use “ ; ”.

For example: 

Clearcollect(Test,{A:”111”});Clear(Test)

It will execute the clearcollect() function first and then execute the clear() function.

 

Best Regards,

Wearsky

If my post helps, then please consider Accept it as the solution to help others. Thanks.

Thanks for that.  I do already have ";" in there.  It actually works ok when clicking one radio button and then waiting even 3 seconds and then clicking the next radio button.  The problem is if they are clicked quickly.  The problem is I can't prevent the user from doing that, but I can't also risk the patches not executing and capturing their entries.

v-xiaochen-msft
Community Support
Community Support

Hi @Pegger ,

 

After you press the first button, it takes a while to execute the formula.

If the second button is pressed during the execution of the formula, the result will indeed be wrong.

 

So, I suggest you modify the display mode property of the second button.

You could try to set a variable.

Set(A,DisplayMode.View)

Then, You could modify the value of the variable at the first button.

Set(A,DisplayMode.Edit)

 

Before the formula of the first button is executed, the second button cannot be clicked.

 

Best Regards,

Wearsky

If my post helps, then please consider Accept it as the solution to help others. Thanks.

View solution in original post

@v-xiochen-msft thank you! This was a great idea and helped me sort it out.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (31,829)