Hi community
With command buttons now in GA as of a few days ago, I'm adding them into a model-driven app build.
The command OnSelect runs a fairly simple series of Power Fx commands (If, Notify, Confirm, Patch). The If and Notify functions first do some simple data validation, and the confirm displays a simple confirmation message. Then the patch updates a yes/no 'trigger' column to yes/true and this in turn triggers a flow using a Dataverse row modify trigger at the end of the flow it switches the trigger column back to no/false - ready for next time.
All is good when the command is run the first time - everything works perfectly. The Power Fx commands work, 'trigger' column goes to yes and the flow runs with the trigger switched back to no at the end.
However, if the command is clicked a second time the Power FX Confirm function works but the Patch isn't updating the 'trigger' column and therefore the flow doesn't run 🤔
Now, I've found out a couple of ways to get it to run. If I remove a value from any of the data validation columns (the ones that the If functions check, it displays the notifications. Replacing the values will then run the Power Fx and flow as normal. The other work around is refreshing the browser, this makes the commands and flow work every time.
Now, instead of telling users they need to refresh the browser in between clicks...what can I do? Is there a function to add to the command to 'reset' it and allow it to run again?!
Thanks
Matt