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 / Are the button onselec...
Power Apps
Answered

Are the button onselect actions sequential?

(0) ShareShare
ReportReport
Posted on by 188

Hello, 

 

I have a button with multiple actions like refresh, patch, etc. and the first action is refreshing a data source, to fetch latest information. 

There are actions that needs to be performed based on the latest information as the app is being used by multiple users, example, a booking app with no approval process. if an item is available, it's yours if you are quick to book. 

 

so, if I click on the button, does the actions, like patch, etc., which are added after the refresh waits until the data source is refreshed?  or its doesn't care and it will patch based on whats already available? 

Categories:
  • BCBuizer Profile Picture
    22,854 Super User 2026 Season 2 on at

    Hi @rjack ,

     

    In general I'd say yes, the code is executed in sequence. 

     

    As for your example I would suggest to refer to the data source directly in the Patch function instead of a control in the app that is populated from cache. It's a much safer option.

  • rjack Profile Picture
    188 on at

    Hi @BCBuizer

    Yes, I understand it is executed in sequence; so, to confirm, you are saying once the of new data is received, only then the next code will be triggered in the same action.

     

    I tried to test this before starting this topic, but my list has less than 50 items so not sure if it is waiting. 

    Thanks for the advice, I am not using any control or a form except user().email function which is not a variable within a session. 

  • Verified answer
    BCBuizer Profile Picture
    22,854 Super User 2026 Season 2 on at

    Hi @rjack ,

     

    I'm not 100% sure the next function will only be executed after the previous one has been completed. What I'm saying is to reference the data source you intend to refresh directly from the patch instead of refreshing it. Like that you avoid any sync issues altogether.

  • Verified answer
    rjack Profile Picture
    188 on at

    @BCBuizer Thanks for the help!

     

    I tested lookup source with and without refresh. this test was on a different data source that has over 3k items, and I can confirm that refresh gets the data and then lookup action is triggered. I am not sure what would the outcome be if the internet is slow, or the server response is slow. 

     

    without refresh command, the data does refresh automatically within power apps, but it takes about 5 to 10 sec.

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 394 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 324 Most Valuable Professional

Last 30 days Overall leaderboard