cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
NigelP
Level 8

Functions / Subroutines / Procedures

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

3 REPLIES 3
Super User
Super User

Re: Functions / Subroutines / Procedures

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.

Highlighted
OneThing
Level 8

Re: Functions / Subroutines / Procedures

+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

 

Community Support Team
Community Support Team

Re: Functions / Subroutines / Procedures

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

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 187 members 6,273 guests
Please welcome our newest community members: