Azure / azure-sdk-tools

Tools repository leveraged by the Azure SDK team.
MIT License
110 stars 174 forks source link

Create a custom component to reuse code (as if there were functions). #4027

Open JonathanCrd opened 2 years ago

JonathanCrd commented 2 years ago

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?

maririos commented 1 year ago

@JonathanCrd can you look into this and see with the new knowledge if we still want this?