Notifications
Announcements
Hi everyone,
I'm facing a challenge in PowerApps due to the lack of user-defined functions, and I’d like to know how others have worked around this limitation.
In my app, I have a search form that allows users to search for a record using different methods (ID, name, barcode scanning, RFID cards, etc.). Once the record is found in the dataset, I load it into an edit form.
The problem is that after loading the record, I need to perform multiple UI updates and validations. However, I don’t want to duplicate this logic in each of my different search routines. Ideally, I’d like to call a single function after retrieving the record to handle all the necessary UI updates in one place.
Since PowerApps doesn’t support user-defined functions, how have you tackled similar situations? Any best practices or workarounds you can recommend?
Thanks in advance!
NOTE: User Defined Functions are supported as 'experimental', so they are not safe for production environments
You can achieve user-defined function (UDF) logic using buttons.
For example, if you want to add two integers as a UDF and retrieve the output, you can follow this approach:
To use this logic:
UpdateContext({lvar_x:10, lvar_y:15, lvar_id:25})
Collect(col_sum, {id: lvar_id, Value: lvar_x + lvar_y})
Lookup(col_sum, id = 25)
This may not be the most conventional approach, but it could work to some extent.
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.
In our never-ending quest to improve we are simplifying the forum hierarchy…
We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
WarrenBelz 717 Most Valuable Professional
Michael E. Gernaey 329 Super User 2025 Season 2
Power Platform 1919 268