Create a custom component to reuse code (as if there were functions).
- Dominant language
- C#
- Stars
- 135
- Forks
- 260
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 143
Description
Currently, Power Apps does not support user defined functions. So, there is not a direct way to reuse code or split the code into multiple steps.
However, there is a workaround I found about using custom components to reuse code. Playing with this, I discovered that we could use the `OnReset` property of the component to trigger a custom behavior property that we can define. I explain it with more details here: https://github.com/Azure/azure-sdk-tools/issues/3956#issuecomment-1223392379
I tested this approach, and it works, but it is very hacky. Is this the best way to reuse code and emulate functions in power apps? Is this workaround worth to implement? Will this impact the apps' performance?
Contributor guide
Research direction
Start by reading the linked issue comment about using a custom component's OnReset property to trigger a custom behavior property. Determine whether this workaround should be recommended or implemented, including its performance implications. The issue does not identify files, tests, or concrete completion criteria.
Written by the indexing model from the issue text.
Assessment
- Domain
- developer-experience
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100