Hi everyone. I have a model-driven application that leverages the Power Apps Grid Control for subgrids on a form. I know how to create a custom button with the command bar editor, and have done so multiple times. What I am trying to accomplish right now is when a user selects a record in the subgrid I want to display a custom button to allow the user to clone that record. When you select the record, a different menu of buttons shows up. Is there a way (using JavaScript or otherwise) to intercept that and display my own button?
@SBax Found what is going wrong here. In modeldriven app you can edit/add commands, here you can select show/formula. If you are at your table and add a command, it's not available.
Though: The command direct from table shows up as long as I don't select a record in subgrid, the one from the modeldriven app doesn't. Looking in that now
This seems like a possible bug, let me try and replicate in my environment and come back to you later
Only show is available
That's what I indeed expected, but can't find a way to change it. Changing it can be done for forms, but in my situation not on subgrid
Hi @AG2019 - if you change the value of visibility to "formula" then you can enter the countries function I detailed above
Hi @SBax ,
Looking for the same solution I read your response and was wondering what you mean with " to do your cloning and set a visibility rule"?
In the new editor I don't see an option to set visibility rule? Only that the button will be shown as long as no row is selected in the grid (displayed when "i" is clicked)
I can't believe it was that simple! Thank you so much @SBax . Marked as solution!
P.S. - Bonus points if you can tell me why I can't Patch(Notifications in my Model-Driven app to create an in-app notification lol...
You could create a new button on the subgrid view in the modern command editor to do your cloning and set a visibility rule on the new button to either :
CountRows(Self.Selected.AllItems) = 1 //(only visible if a single row is selected)
Or
CountRows(Self.Selected.AllItems) > 0 //(visible if one or more rows are selected)
Does this cover what you need?
Feel free to drop any additional questions in a reply
WarrenBelz
223
Most Valuable Professional
MS.Ragavendar
110
stampcoin
86