Showing results for 
Search instead for 
Did you mean: 

An option to create new custom functions in PowerApps in libraries

The coding part of PowerApps can contain complex code. It would be great if the code could be simplified by storying the code in libraries that can be maintained from within the PowerApps Studio.

Status: Under Review
Resident Rockstar

I agree with Pieter that this should be a PowerApps changing feature when this becomes possible.  When your add it:

  • then make it possible to export/import this library, so we can export it to other apps.
  • also add password and security properties. A bit like in vba excel.


I posted an idea on this matter my self a few months ago, see threat:

Community Champion
Status changed to: Under Review
Kudo Kingpin

We are in the middle of developing a large PowerApps app and the amout of "code smell" is really high. We basically have copy-pasted formulas all over the place. If we update the logic in one place we have to remember to do the same in several other places. Considering there is no way to search for formulas in PowerApps - we have a perfect storm situation

Kudo Kingpin
Kudo Kingpin

Just to link similar posts:

Consider voting for these ideas 🙂

Not applicable

Agreed!  A sortable library of code, in a customizable pop-out window/pallet, would be far better than the Word doc compilation I am currently using.

Kudo Collector

@DenisMolodtsov  I totally feel your pain.  One thing I've had to resort to when making changes to a cloned function and I cannot recall all the places a clone exists is to export the msapp file and use Notepad++ to hunt through the unzipped msapp with Find/Replace.  I still have to go back into the PA Studio to go to each clone and make the change, but it has helped me find clones I totally forgot about. PITA but it's been better than nothing.  

Super User
Super User

@mr-dang This * * * * IMPORTANT * * * feature has been under review for 2 years. A similar idea,

has been under review for nearly 4 years. Another one also for 2 years, 

How on earth could you call a platform "LOW-CODE" with no possibility for code reuse. What does this "UNDER REVIEW" mean? Probably it is - "JUST SWEEP IT UNDER THE CARPET!!!" Does it take the world's largest SW company 4 years to review such a small feature request? Come on.

Kudo Kingpin
Kudo Kingpin

PA is dead. The biggest changes they did in the last 2 years were in the billing policy. The only changes I witnessed in my workflow was PA getting slower and slower as time goes by without adding any good features. (Good as features wanted by the community).


Yes, I'm salty about licenses going from 10 to 40$ per user for using AZURE SQL...

Super User

Power Apps now has custom functions as an experimental feature.  You can use them to store repetitive code and call the function as as many times as needed.  I created a custom function to calculate the 'last day of the month' for a given date.

Check out this link to find out how I made it:



Resident Rockstar

@mdevaney, Hi Matthew, I would like to react to your message about custom functions in Power Apps. 

How I look at this idea this implementation is not what we mean, hope others agree. The thing is that we would like to have a place to put in complex Power FX formula sequences we like to reuse from multiple places in our app. The formula could be something like:

        project: _ProjectSelected
            : Filter(
                    {step: 1, Title: "Option 1"}
                    ,{step: 1, Title: "Option 2"}
                    ,{step: 1, Title: "Option 3"}
                    ,{step: 2, Title: "Option 4"}
                    ,{step: 2, Title: "Option 5"}
                    ,{step: 3, Title: "Option 6"}
                , Step = _ProjectSelected.Step + 1)
    , If(Not(IsEmpty(table))
        ,Patch(Option, AddColumns(table, "Project", { Id: project.ID, Value: project.Title }))
Notify("Your Options are created");
UpdateContext({_MyFormPopup: {enable: false, record:Blank()}});

 What this would do is create items in a child list based on a step in the process of a project, gives a notification, and closes a popup in which we triggered a FormSubmit(). The code I just make up right now and the code could become even more complex easily.

Because I like my apps to be organized properly I like to place these complex functions centralized, so they are easy to find. To achieve this, I now add a container (I call Actions_1) on my screen, and in this container, I place toggle controls which I trigger with a variable, and thenOnChange I have my formulas. This works like a charm but takes time to build and increases the number of controls on the screen. It would be nice that we have a place in the ribbon next to the Flow Actions to put those formulas. 

The problem with the current implementation is that the component is not aware of the controls on the screens, so we can't just call them in a component.

Hope this makes more clear what I would like to get in Power Apps. 

Thanks for all the support on the community and you're tutorials on YouTube.