I have several labels, buttons, etc that need to execute the exact same commands. I was hoping to find a way to have a common point to direct the OnSelect of all of these items, so when I need to make a change to these common commands, I dont have to copy them to 20 different OnSelect controls. Any help on this one?
Common commands:
UpdateContext({WhereUsedSelected:PlainText(ThisItem.Result)});UpdateContext({ CurrentRevision:Value(LookUp(Master_Drawing_List,MD_PartNumber=Text(WhereUsedSelected)).MD_LatestRevNumber), CurrentShown:true});UpdateContext({LookupFilename:LookUp(Drawing_Vault,DV_PartNumber=Text(WhereUsedSelected) And DV_RevisionNumber=CurrentRevision,'{FilenameWithExtension}')}); UpdateContext({NextRev:CurrentRevision+1}); ClearCollect(PdfContent, DataCentralViewPDF.Run(LookupFilename))
Solved! Go to Solution.
I have been creating invisible buttons that I name something like functionDoThis. And then I type in the redundant code into the functionDoThis.OnSelect. Everytime I want to invoke that redundant code, I just type in Select(functionDoThis).
Note that you can only select an object that is on the same screen, so the so-called function would only work within the context of its screen.
This may not be the best way to do this, but it works for me. If you can't find anything better, I hope this works for you 🙂
I have been creating invisible buttons that I name something like functionDoThis. And then I type in the redundant code into the functionDoThis.OnSelect. Everytime I want to invoke that redundant code, I just type in Select(functionDoThis).
Note that you can only select an object that is on the same screen, so the so-called function would only work within the context of its screen.
This may not be the best way to do this, but it works for me. If you can't find anything better, I hope this works for you 🙂
No, this sounds perfect. It will handle exactly what I need. Thanks so much!
Good thoughts and thank you.
We need this to work on multiple screens.
Reusable functions functions (and patch statements) would be a great addition to the PowerApps product.
User | Count |
---|---|
153 | |
93 | |
84 | |
77 | |
58 |
User | Count |
---|---|
197 | |
176 | |
106 | |
96 | |
89 |