web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Custom Button on Subgr...
Power Apps
Answered

Custom Button on Subgrid when record is selected

(0) ShareShare
ReportReport
Posted on by 9

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?

 

 

Record Not Selected.png
Record Selected.png
Categories:
I have the same question (0)
  • Verified answer
    SBax Profile Picture
    1,348 on at

    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

  • gbundy Profile Picture
    9 on at

    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...

  • AG2019 Profile Picture
    25 on at

    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)

    AG2019_0-1707314406976.png

     

  • SBax Profile Picture
    1,348 on at

    Hi @AG2019 - if you change the value of visibility to "formula" then you can enter the countries function I detailed above 

  • AG2019 Profile Picture
    25 on at

    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

  • AG2019 Profile Picture
    25 on at

    AG2019_1-1707316141921.png

    Only show is available

     

  • SBax Profile Picture
    1,348 on at

    This seems like a possible bug, let me try and replicate in my environment and come back to you later

  • AG2019 Profile Picture
    25 on at

    @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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 519 Most Valuable Professional

#2
11manish Profile Picture

11manish 489

#3
Haque Profile Picture

Haque 327

Last 30 days Overall leaderboard