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 / executing the same lar...
Power Apps
Unanswered

executing the same large bunch of code on two diferent forms

(0) ShareShare
ReportReport
Posted on by 711

Hi,

 

In the mainform my app there is a fairly large procedure in which many lookup tables are cached. Some of the users of this app are mainly on another form of the app in which I like to offer the possibility to execute this same code (to refresh the data) without having to go back to the main screen. The code is in the onselect property of a button but I cannot do a select(button) from another form.

In other programming languages this is called a "procedure". This is meant to avoid repeating the same code and having to maintain the app on multiple places for just one change.

Maybe there is some way to accomplish this in powerapps but if not I would think it would be less than technically impossible to have some way to refer to a piece of code from anywhere within the app.

Is there some elegant way to deal with this in powerapps as it is?

Categories:
  • timl Profile Picture
    37,287 Super User 2026 Season 2 on at

    Hi @HansHeintz 

    The closet thing in Power Apps is "named formulas".

    https://powerapps.microsoft.com/en-us/blog/power-fx-introducing-named-formulas

    A current limitation is that it isn't possible to define parameters, but this is a feature that's coming soon.

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 432 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 347

#3
WarrenBelz Profile Picture

WarrenBelz 254 Most Valuable Professional

Last 30 days Overall leaderboard