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 / Functions / Subroutine...
Power Apps
Unanswered

Functions / Subroutines / Procedures

(0) ShareShare
ReportReport
Posted on by 1,302

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

Categories:
I have the same question (0)
  • timl Profile Picture
    37,283 Super User 2026 Season 2 on at

    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.

  • OneThing Profile Picture
    393 on at

    +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

     

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    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.

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
WarrenBelz Profile Picture

WarrenBelz 392 Most Valuable Professional

#2
11manish Profile Picture

11manish 181 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 112 Super User 2026 Season 2

Last 30 days Overall leaderboard