Announcements
Hi
Are there any plans to introduce Functions / Subroutines / Procedures into PowerApps.
I am finding the OnSelect scripts are becoming very large (100s to 1000s lines) and difficult to maintain as the same lines are repeated numerous times.
Regards
Nigel
Hi Nigel,
There's a post in the ideas forum about this. Unfortunately, it's still under review.
https://powerusers.microsoft.com/t5/PowerApps-Ideas/Create-custom-functions-macros/idi-p/6187
Do you ever use the Select function?
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-select
To you make your OnSelect code more maintainable, you could split it over multiple hidden buttons and call each button with the Select function.
+1 for this.
I did look a little into creating a Collection of Code Snippets, ala:
Set( firstCharVai, "Hello" ); Collect( CodeSnips, { Name: "FirstChar", Code: Left( firstCharVai, 1 ) } ) And LookUp( CodeSnips, Name = "FirstChar", Code )
Which gives me the code but you need to set the variables on your page rather than passing them to the function.Might give someone a start though Thanks,Nicky
Hi @NigelP,
Thanks for your feedback.
Currently, custom functions, Subroutines and Procedures are not supported within PowerApps.
If you would like this feature to be added in PowerApps, please submit an idea to PowerApps Ideas Forum:
https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas
Best regards,
Kris
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.
Congratulations to our community stars!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
WarrenBelz 356 Most Valuable Professional
11manish 225 Super User 2026 Season 2
Mohsin Ali 211