So I have a PowerApp with a gallery that people search, and then click on records/items in order to edit them within a form.
Once they select the icon in the gallery (circled in red) I want the Submit button to be clickable, but for it to be greyed out/disabled on form load. Can this be done? All the edit buttons I am seeing sit within the Gallery, so the formulas offered don't make any sense.
I have already tweaked the app not to use the top gallery item as the selected item.
Simplest approach would be to use a variable.
UpdateContext({locEnableSubmit: false});
Then, when appropriate (like when clicking a Gallery button) toggle it to true:
UpdateContext({locEnableSubmit: true});
The advantages of a Boolean variable like this is the simplicity in evaluating and setting it.
On your button, you could do
If(locEnableSubmit, DisplayMode.Edit, DisplayMode.Disabled)
You can also always have other actions (like OnHidden of screen, or click of another button, reset the Boolean to false).
Thanks for the reply! I had read that using the context variable would be a good way to solve this. Your explanation helped a lot, although I am unsure what properties to assign the false part to? Like I I am updating the variable to true on Click of a gallery button, where do I assign the flase part?
Also, I've seen others name variables 'loc' - what does it stand for and why loc?
Many thanks!
I am also Facing the similar issue , I gave UpdateContext({VarTriggerButton:True}) on the Onchange Property of Text Input field(Parent Gallery) and Placed an Invisible button in the Nested Gallery and Onselect Property of tht button I gave If(VarTriggerButton, Updateif Condition) the Variable is returning true but its not able to Patch at the backend
(Update if Condition works on the onselect property of the btn without if condition)
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
199 | |
52 | |
41 | |
39 | |
35 |
User | Count |
---|---|
263 | |
86 | |
71 | |
69 | |
66 |