Thanks @Jason_Hough, I realise your solution was posted a while ago now but hoped you could help me - I am trying to integrate your solution into my project however I am not quite sure what to do with the code currently driving the DisplayMode on the button.
i.e. requirements...
- If payment due date is in the future, disable the 'Chase Payment' button (otherwise enable it)
- Disable 'Chase Payment' button when users clicks it (and triggers the flow).
Previously I had:
SendChaseButton.DisplayMode
If(ThisItem.DueDate<TimeNow,DisplayMode.Edit,DisplayMode.Disabled)
SendChaseButton.OnSelect
PowerAppsbutton.Run(ThisItem.ID);SendChaseButton.DisplayMode=DisplayMode.Disabled #<-- Doesn't work
I updated the code to use a context variable as you recommended:
SendChaseButton.DisplayMode
ButtonStatus
SendChaseButton.OnSelect
PowerAppsbutton.Run(ThisItem.ID);UpdateContext({ButtonStatus:DisplayMode.Disabled})
... however, while this does now disable the button when the user clicks it, it no longer sets it's initial status -- I tried to incorporate the context variable with my previous If statement, however it would not accept this syntax.
Any help you can give me would be grately appreciated!