@BrianHFASPS
There is a technique for buttons on the same screen.
Say you have 3 buttons Button1, Button2, Button3 all with the same code in the OnSelect property
line_1;
line_2;
line_3;
...
line_50;
To avoid repetition you can create another button named function_RefreshSQL and put the 50 lines of code in the OnSelect property.
line_1;
line_2;
line_3;
...
line_50;
Its a good idea to hide the function_RefreshSQL button since we dont want the user to click it. Change the Visible property to the following code.
false
Now go back to Button1, Button2, Button3 and change the code in the OnSelect property the code below. When any of those buttons are clicked on it will run the code in function_refreshSQL instead.
Select(function_refreshSQL)
This only works for buttons on the same screen. One creative way to get around that limitation would be to build your entire app on a single screen. Whether you want to do that will depend on your own preferences
Link to documentation
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-select
---
Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly. If your thought the post was helpful please give it a "Thumbs Up."