We are thrilled to announce that User defined functions (UDFs) in Power Apps have reached general availability! They are now ready for your production workloads. Thank you to everyone who provided valuable feedback on this feature and helped us reach this milestone!
With version 2508.3 the UDF preview switch has been removed and the new analysis engine switch (in the New section) has been updated to include UDFs. UDFs are dependent on the new analysis engine which is why we have combined them. This switch is enabled by default for new apps.

User defined function benefits
If you are new to UDFs, they make apps easier to create, understand, test, and maintain. They also help Studio load and save apps faster.
How do they do this?
Instead of writing logic into each individual control’s properties, often replicating similar logic across the app, extract common logic into a single UDF with parameters to control how it works. The UDF is easier to understand, test, and maintain in isolation from any one place it is used. Duplication of logic is reduced which avoids multiple versions from getting out of sync. Modularization of logic is a time-honored strategy for scaling up the complexity of programs and apps.
For example, a simple UDF may do a calculation based on parameters, as in this example of a Fahrenheit to Celsius converter, placed in App.Formulas of a Canvas app:
FtoC( f: Number ) : Number = (f - 32) / 1.8;

We can use the label control to see the result of automatically evaluating this function with a constant input:

We can also add a slider to drive the input to the function and see that result. Our function hasn’t changed and now it is being used in two different ways. Not only that, as the slider changes, the function’s result is recalculated automatically, just as built in function are:

User defined functions can also perform actions. In this example, we have a function to add an entry to a collection and display a notification, wrapped in curly braces as it has side effects:
AddSale( customer: Text, amount: Number ) : Void = {
Collect( Sales, { Customer: customer, Amount: amount } );
Notify($"Sale to {customer} of {Text(amount, "$ #,###.00")}"); };

We call this function from a Button control OnSelect event, bind a DataTable control to the collection, and witness the results of the actions taken by the function:

More details…
For more information see User defined functions in the docs.
User defined types (UDTs), which enable passing record and tables in and out of UDFs, are still a work in progress that we plan to bring to GA shortly.